StickyNotePopup.xaml 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. <annotview:StickyPopupExt
  2. x:Class="PDF_Master.Views.PropertyPanel.AnnotPanel.StickyNotePopup"
  3. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  4. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5. xmlns:annotview="clr-namespace:ComPDFKitViewer;assembly=ComPDFKit.Viewer"
  6. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  7. xmlns:local="clr-namespace:PDF_Master.Views.PropertyPanel.AnnotPanel"
  8. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  9. xmlns:prism="http://prismlibrary.com/"
  10. xmlns:viewmodels="clr-namespace:PDF_Master.ViewModels.PropertyPanel.AnnotPanel"
  11. Width="240"
  12. Height="200"
  13. d:DataContext="{d:DesignInstance Type=viewmodels:StickyNotePopupViewModel}"
  14. d:DesignHeight="450"
  15. d:DesignWidth="800"
  16. prism:ViewModelLocator.AutoWireViewModel="True"
  17. Background="Transparent"
  18. mc:Ignorable="d">
  19. <annotview:StickyPopupExt.Resources>
  20. <DataTemplate x:Key="listboxData">
  21. <Ellipse
  22. Width="20"
  23. Height="20"
  24. Fill="{Binding Color}"
  25. Stroke="{StaticResource color.sys.layout.divider}"
  26. StrokeThickness="1" />
  27. </DataTemplate>
  28. <Style x:Key="listboxItemStyle" TargetType="{x:Type ListBoxItem}">
  29. <Setter Property="HorizontalContentAlignment" Value="Center" />
  30. <Setter Property="Height" Value="32" />
  31. <Setter Property="Width" Value="32" />
  32. <Setter Property="Margin" Value="2,0,2,0" />
  33. <Setter Property="Template">
  34. <Setter.Value>
  35. <ControlTemplate TargetType="{x:Type ContentControl}">
  36. <Border
  37. x:Name="border"
  38. Padding="0,0"
  39. Background="{TemplateBinding Background}"
  40. CornerRadius="4">
  41. <ContentPresenter />
  42. </Border>
  43. </ControlTemplate>
  44. </Setter.Value>
  45. </Setter>
  46. <Style.Triggers>
  47. <Trigger Property="IsMouseOver" Value="True">
  48. <Setter Property="Background" Value="#e2e3e5" />
  49. </Trigger>
  50. <Trigger Property="IsMouseOver" Value="False">
  51. <Setter Property="Background" Value="Transparent" />
  52. </Trigger>
  53. <Trigger Property="IsSelected" Value="True">
  54. <Setter Property="Background" Value="#e2e3e5" />
  55. </Trigger>
  56. </Style.Triggers>
  57. </Style>
  58. </annotview:StickyPopupExt.Resources>
  59. <Grid DataContext="{x:Null}" MouseLeftButtonDown="Grid_MouseLeftButtonDown">
  60. <Border
  61. x:Name="border"
  62. Width="240"
  63. Height="200"
  64. MinWidth="240"
  65. MinHeight="200"
  66. Background="{StaticResource color.sys.layout.anti}"
  67. BorderBrush="#ffe49a"
  68. BorderThickness="2"
  69. CornerRadius="8">
  70. <Border.Effect>
  71. <DropShadowEffect
  72. BlurRadius="8"
  73. Direction="0"
  74. Opacity="0.16"
  75. ShadowDepth="0"
  76. Color="#000000" />
  77. </Border.Effect>
  78. <Grid
  79. Name="GridUi"
  80. Width="240"
  81. Height="200"
  82. MinWidth="240"
  83. MinHeight="200"
  84. Background="Transparent">
  85. <Grid.RowDefinitions>
  86. <RowDefinition Height="32" />
  87. <RowDefinition Height="auto" />
  88. <RowDefinition Height="*" />
  89. <RowDefinition Height="auto" />
  90. </Grid.RowDefinitions>
  91. <Grid Margin="8,0,8,0">
  92. <Grid.ColumnDefinitions>
  93. <ColumnDefinition Width="auto" />
  94. <ColumnDefinition Width="auto" />
  95. <ColumnDefinition Width="*" />
  96. <ColumnDefinition Width="auto" />
  97. <ColumnDefinition Width="auto" />
  98. </Grid.ColumnDefinitions>
  99. <TextBlock
  100. x:Name="AuthorText"
  101. Grid.Column="1"
  102. Margin="2,2,0,0"
  103. VerticalAlignment="Center"
  104. FontFamily="SegoeUI"
  105. FontSize="12"
  106. LineHeight="16"
  107. Text="{Binding AuthorText}" />
  108. <TextBlock
  109. Name="DateText"
  110. Grid.Column="3"
  111. Margin="0,-2,0,0"
  112. VerticalAlignment="Center"
  113. FontFamily="SegoeUI"
  114. FontSize="12"
  115. Foreground="{StaticResource color.sys.text.neutral.lv2}"
  116. LineHeight="16"
  117. Text="{Binding DateText}" />
  118. <Border
  119. Grid.Column="4"
  120. Margin="0,-8,-3,0"
  121. Background="#01000000"
  122. MouseUp="CloseText_MouseUp"
  123. Visibility="Collapsed">
  124. <Path
  125. Width="16"
  126. Height="16"
  127. Fill="#000000">
  128. <Path.Data>
  129. M9.48528137,2.98528137 L9.48428137,8.48428137 L14.9852814,8.48528137 L14.9852814,9.48528137 L9.48428137,9.48428137 L9.48528137,14.9852814 L8.48528137,14.9852814 L8.48428137,9.48428137 L2.98528137,9.48528137 L2.98528137,8.48528137 L8.48428137,8.48428137 L8.48528137,2.98528137 L9.48528137,2.98528137 Z
  130. </Path.Data>
  131. <Path.LayoutTransform>
  132. <RotateTransform Angle="45" />
  133. </Path.LayoutTransform>
  134. </Path>
  135. </Border>
  136. </Grid>
  137. <Rectangle
  138. Height="1"
  139. Margin="8,0,8,0"
  140. VerticalAlignment="Bottom"
  141. Fill="{StaticResource color.sys.layout.divider}" />
  142. <TextBox
  143. x:Name="ContentText"
  144. Grid.Row="2"
  145. Margin="4,0,4,0"
  146. Padding="2,4,0,0"
  147. AcceptsReturn="True"
  148. Background="#CCFFFFFF"
  149. BorderThickness="0"
  150. Text="{Binding ContentText}"
  151. TextWrapping="Wrap"
  152. VerticalScrollBarVisibility="Auto" />
  153. <Grid Grid.Row="3">
  154. <ListBox
  155. x:Name="ListColor"
  156. Background="Transparent"
  157. BorderThickness="0"
  158. ItemContainerStyle="{StaticResource listboxItemStyle}"
  159. ItemTemplate="{StaticResource listboxData}"
  160. SelectionChanged="ListColor_SelectionChanged">
  161. <ListBox.ItemsPanel>
  162. <ItemsPanelTemplate>
  163. <WrapPanel Orientation="Horizontal" />
  164. </ItemsPanelTemplate>
  165. </ListBox.ItemsPanel>
  166. </ListBox>
  167. </Grid>
  168. <Button
  169. x:Name="BtnDelete"
  170. Grid.Row="3"
  171. Width="32"
  172. Height="32"
  173. MaxHeight="40"
  174. Margin="16,0,10,5"
  175. HorizontalAlignment="Right"
  176. BorderThickness="0"
  177. Click="BtnDelete_Click"
  178. Foreground="#6B6F7D"
  179. Style="{StaticResource btn.sec}">
  180. <Path
  181. Width="32"
  182. Height="32"
  183. Data="M14 9.75H18V8.25H14V9.75ZM9 12.25H10.25V23C10.25 23.4142 10.5858 23.75 11 23.75H21C21.4142 23.75 21.75 23.4142 21.75 23V12.25H23V10.75H9V12.25ZM11.75 22.25V12.25H20.25V22.25H11.75ZM15.25 14.5V19.5H16.75V14.5H15.25Z"
  184. Fill="{Binding ElementName=BtnDelete, Path=Foreground}" />
  185. </Button>
  186. <ResizeGrip
  187. Name="GripControl"
  188. Grid.Row="3"
  189. Margin="0,2,0,0"
  190. HorizontalAlignment="Right"
  191. Cursor="SizeNWSE"
  192. MouseMove="ResizeGrip_MouseMove"
  193. Visibility="Collapsed" />
  194. </Grid>
  195. </Border>
  196. </Grid>
  197. </annotview:StickyPopupExt>