StickyNotePopup.xaml 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  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. PreviewKeyDown="StickyPopupExt_PreviewKeyDown"
  17. prism:ViewModelLocator.AutoWireViewModel="True"
  18. Background="Transparent"
  19. mc:Ignorable="d">
  20. <annotview:StickyPopupExt.Resources>
  21. <DataTemplate x:Key="listboxData">
  22. <Ellipse
  23. Width="20"
  24. Height="20"
  25. Fill="{Binding Color}"
  26. Stroke="{StaticResource color.sys.layout.divider}"
  27. StrokeThickness="1" />
  28. </DataTemplate>
  29. <Style x:Key="listboxItemStyle" TargetType="{x:Type ListBoxItem}">
  30. <Setter Property="HorizontalContentAlignment" Value="Center" />
  31. <Setter Property="Height" Value="32" />
  32. <Setter Property="Width" Value="32" />
  33. <Setter Property="Margin" Value="2,0,2,0" />
  34. <Setter Property="Template">
  35. <Setter.Value>
  36. <ControlTemplate TargetType="{x:Type ContentControl}">
  37. <Border
  38. x:Name="border"
  39. Padding="0,0"
  40. Background="{TemplateBinding Background}"
  41. CornerRadius="4">
  42. <ContentPresenter />
  43. </Border>
  44. </ControlTemplate>
  45. </Setter.Value>
  46. </Setter>
  47. <Style.Triggers>
  48. <Trigger Property="IsMouseOver" Value="True">
  49. <Setter Property="Background" Value="#e2e3e5" />
  50. </Trigger>
  51. <Trigger Property="IsMouseOver" Value="False">
  52. <Setter Property="Background" Value="Transparent" />
  53. </Trigger>
  54. <Trigger Property="IsSelected" Value="True">
  55. <Setter Property="Background" Value="#e2e3e5" />
  56. </Trigger>
  57. </Style.Triggers>
  58. </Style>
  59. </annotview:StickyPopupExt.Resources>
  60. <Grid DataContext="{x:Null}" MouseLeftButtonDown="Grid_MouseLeftButtonDown">
  61. <Border
  62. x:Name="border"
  63. Width="240"
  64. Height="200"
  65. MinWidth="240"
  66. MinHeight="200"
  67. Background="{StaticResource color.sys.layout.anti}"
  68. BorderBrush="#ffe49a"
  69. BorderThickness="2"
  70. CornerRadius="8">
  71. <Border.Effect>
  72. <DropShadowEffect
  73. BlurRadius="8"
  74. Direction="0"
  75. Opacity="0.16"
  76. ShadowDepth="0"
  77. Color="#000000" />
  78. </Border.Effect>
  79. <Grid
  80. Name="GridUi"
  81. Width="240"
  82. Height="200"
  83. MinWidth="240"
  84. MinHeight="200"
  85. Background="Transparent">
  86. <Grid.RowDefinitions>
  87. <RowDefinition Height="32" />
  88. <RowDefinition Height="auto" />
  89. <RowDefinition Height="*" />
  90. <RowDefinition Height="auto" />
  91. </Grid.RowDefinitions>
  92. <Grid Margin="8,0,8,0">
  93. <Grid.ColumnDefinitions>
  94. <ColumnDefinition Width="auto" />
  95. <ColumnDefinition Width="auto" />
  96. <ColumnDefinition Width="*" />
  97. <ColumnDefinition Width="auto" />
  98. <ColumnDefinition Width="auto" />
  99. </Grid.ColumnDefinitions>
  100. <TextBlock
  101. x:Name="AuthorText"
  102. Grid.Column="1"
  103. Margin="2,2,0,0"
  104. VerticalAlignment="Center"
  105. FontFamily="SegoeUI"
  106. FontSize="12"
  107. LineHeight="16"
  108. Text="{Binding AuthorText}" />
  109. <TextBlock
  110. Name="TxtDate"
  111. Grid.Column="3"
  112. Margin="0,-2,0,0"
  113. VerticalAlignment="Center"
  114. FontFamily="SegoeUI"
  115. FontSize="12"
  116. Foreground="{StaticResource color.sys.text.neutral.lv2}"
  117. LineHeight="16"
  118. Text="{Binding DateText}" />
  119. <Border
  120. Grid.Column="4"
  121. Margin="0,-8,-3,0"
  122. Background="#01000000"
  123. MouseUp="CloseText_MouseUp"
  124. Visibility="Collapsed">
  125. <Path
  126. Width="16"
  127. Height="16"
  128. Fill="#000000">
  129. <Path.Data>
  130. 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
  131. </Path.Data>
  132. <Path.LayoutTransform>
  133. <RotateTransform Angle="45" />
  134. </Path.LayoutTransform>
  135. </Path>
  136. </Border>
  137. </Grid>
  138. <Rectangle
  139. Height="1"
  140. Margin="8,0,8,0"
  141. VerticalAlignment="Bottom"
  142. Fill="{StaticResource color.sys.layout.divider}" />
  143. <TextBox
  144. x:Name="ContentText"
  145. Grid.Row="2"
  146. Margin="4,0,4,0"
  147. Padding="2,4,0,0"
  148. AcceptsReturn="True"
  149. Background="#CCFFFFFF"
  150. BorderThickness="0"
  151. Text="{Binding ContentText}"
  152. TextWrapping="Wrap"
  153. VerticalScrollBarVisibility="Auto" />
  154. <Grid Grid.Row="3">
  155. <ListBox
  156. x:Name="ListColor"
  157. Background="Transparent"
  158. BorderThickness="0"
  159. ItemContainerStyle="{StaticResource listboxItemStyle}"
  160. ItemTemplate="{StaticResource listboxData}"
  161. SelectionChanged="ListColor_SelectionChanged">
  162. <ListBox.ItemsPanel>
  163. <ItemsPanelTemplate>
  164. <WrapPanel Orientation="Horizontal" />
  165. </ItemsPanelTemplate>
  166. </ListBox.ItemsPanel>
  167. </ListBox>
  168. </Grid>
  169. <Button
  170. x:Name="BtnDelete"
  171. Grid.Row="3"
  172. Width="32"
  173. Height="32"
  174. MaxHeight="40"
  175. Margin="16,0,10,5"
  176. HorizontalAlignment="Right"
  177. BorderThickness="0"
  178. Click="BtnDelete_Click"
  179. Foreground="#6B6F7D"
  180. Style="{StaticResource btn.sec}">
  181. <Path
  182. Width="32"
  183. Height="32"
  184. 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"
  185. Fill="{Binding ElementName=BtnDelete, Path=Foreground}" />
  186. </Button>
  187. <ResizeGrip
  188. Name="GripControl"
  189. Grid.Row="3"
  190. Margin="0,2,0,0"
  191. HorizontalAlignment="Right"
  192. Cursor="SizeNWSE"
  193. MouseMove="ResizeGrip_MouseMove"
  194. Visibility="Collapsed" />
  195. </Grid>
  196. </Border>
  197. </Grid>
  198. </annotview:StickyPopupExt>