StickyNotePopup.xaml 8.7 KB

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