StickyNotePopup.xaml 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. <annotview:StickyPopupExt x:Class="PDF_Office.Views.PropertyPanel.AnnotPanel.StickyNotePopup"
  2. xmlns:annotview="clr-namespace:ComPDFKitViewer;assembly=ComPDFKit.Viewer"
  3. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  4. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  6. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  7. xmlns:local="clr-namespace:PDF_Office.Views.PropertyPanel.AnnotPanel"
  8. mc:Ignorable="d" Background="Transparent"
  9. d:DesignHeight="450" d:DesignWidth="800">
  10. <annotview:StickyPopupExt.Resources>
  11. <DataTemplate x:Key="listboxData">
  12. <Ellipse Stroke="{StaticResource color.sys.layout.divider}"
  13. StrokeThickness="1"
  14. Width="20"
  15. Height="20"
  16. Fill="{Binding Color}" />
  17. </DataTemplate>
  18. <Style x:Key="listboxItemStyle" TargetType="{x:Type ListBoxItem}">
  19. <Setter Property="HorizontalContentAlignment" Value="Center" />
  20. <Setter Property="Height" Value="32"/>
  21. <Setter Property="Width" Value="32"/>
  22. <Setter Property="Margin" Value="2,0,2,0" />
  23. <Setter Property="Template">
  24. <Setter.Value>
  25. <ControlTemplate TargetType="{x:Type ContentControl}">
  26. <Border CornerRadius="4"
  27. x:Name="border"
  28. Padding="0,0"
  29. Background="{TemplateBinding Background}">
  30. <ContentPresenter />
  31. </Border>
  32. </ControlTemplate>
  33. </Setter.Value>
  34. </Setter>
  35. <Style.Triggers>
  36. <Trigger Property="IsMouseOver" Value="True">
  37. <Setter Property="Background" Value="#e2e3e5" />
  38. </Trigger>
  39. <Trigger Property="IsMouseOver" Value="False">
  40. <Setter Property="Background" Value="Transparent" />
  41. </Trigger>
  42. <Trigger Property="IsSelected" Value="True">
  43. <Setter Property="Background" Value="#e2e3e5" />
  44. </Trigger>
  45. </Style.Triggers>
  46. </Style>
  47. </annotview:StickyPopupExt.Resources>
  48. <Grid MouseLeftButtonDown="Grid_MouseLeftButtonDown">
  49. <Border x:Name="border" Background="{StaticResource color.sys.layout.anti}" CornerRadius="8" BorderThickness="2" BorderBrush="#ffe49a" MinWidth="240" MinHeight="200" Width="240" Height="200" >
  50. <Border.Effect>
  51. <DropShadowEffect BlurRadius="8" Direction="0" Opacity="0.16" ShadowDepth="0" Color="#000000" />
  52. </Border.Effect>
  53. <Grid MinWidth="240" MinHeight="200" Background="Transparent" Name="GridUi" Width="240" Height="200">
  54. <Grid.RowDefinitions>
  55. <RowDefinition Height="32"></RowDefinition>
  56. <RowDefinition Height="auto"></RowDefinition>
  57. <RowDefinition Height="*"></RowDefinition>
  58. <RowDefinition Height="auto"></RowDefinition>
  59. </Grid.RowDefinitions>
  60. <Grid Margin="8,0,8,0">
  61. <Grid.ColumnDefinitions>
  62. <ColumnDefinition Width="auto"></ColumnDefinition>
  63. <ColumnDefinition Width="auto"></ColumnDefinition>
  64. <ColumnDefinition Width="*"></ColumnDefinition>
  65. <ColumnDefinition Width="auto"></ColumnDefinition>
  66. <ColumnDefinition Width="auto"></ColumnDefinition>
  67. </Grid.ColumnDefinitions>
  68. <TextBlock x:Name="AuthorText" Grid.Column="1" FontFamily="SegoeUI" FontSize="12" VerticalAlignment="Center" LineHeight="16" Margin="2,2,0,0"/>
  69. <TextBlock Name="DateText" Grid.Column="3" Foreground="{StaticResource color.sys.text.neutral.lv2}" VerticalAlignment="Center" Margin="0,-2,0,0" FontFamily="SegoeUI" FontSize="12" LineHeight="16"></TextBlock>
  70. <Border Grid.Column="4" Visibility="Collapsed" MouseUp="CloseText_MouseUp" Background="#01000000" Margin="0,-8,-3,0">
  71. <Path Fill="#000000" Width="16" Height="16" >
  72. <Path.Data>
  73. 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
  74. </Path.Data>
  75. <Path.LayoutTransform>
  76. <RotateTransform Angle="45"></RotateTransform>
  77. </Path.LayoutTransform>
  78. </Path>
  79. </Border>
  80. </Grid>
  81. <Rectangle Margin="8,0,8,0" VerticalAlignment="Bottom" Height="1" Fill="{StaticResource color.sys.layout.divider}"/>
  82. <TextBox x:Name="ContentText" Grid.Row="2" Padding="2,4,0,0" Margin="4,0,4,0" Background="#CCFFFFFF" BorderThickness="0"
  83. AcceptsReturn="True" TextWrapping="Wrap" VerticalScrollBarVisibility="Auto"></TextBox>
  84. <Grid Grid.Row="3">
  85. <ListBox
  86. x:Name="ListColor"
  87. Background="Transparent"
  88. BorderThickness="0"
  89. ItemContainerStyle="{StaticResource listboxItemStyle}"
  90. ItemTemplate="{StaticResource listboxData}"
  91. SelectionChanged="ListColor_SelectionChanged"
  92. >
  93. <ListBox.ItemsPanel>
  94. <ItemsPanelTemplate>
  95. <WrapPanel Orientation="Horizontal" />
  96. </ItemsPanelTemplate>
  97. </ListBox.ItemsPanel>
  98. </ListBox>
  99. </Grid>
  100. <Button
  101. x:Name="BtnDelete" HorizontalAlignment="Right"
  102. Width="32" Grid.Row="3"
  103. Height="32"
  104. MaxHeight="40"
  105. Margin="16,0,10,5" BorderThickness="0"
  106. Foreground="#6B6F7D" Click="BtnDelete_Click"
  107. Style="{StaticResource btn.sec}">
  108. <Path
  109. Width="32"
  110. Height="32"
  111. 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"
  112. Fill="{Binding ElementName=BtnDelete, Path=Foreground}" />
  113. </Button>
  114. <ResizeGrip Name="GripControl" Visibility="Collapsed" Grid.Row="3" HorizontalAlignment="Right" Margin="0,2,0,0" Cursor="SizeNWSE" MouseMove="ResizeGrip_MouseMove"></ResizeGrip>
  115. </Grid>
  116. </Border>
  117. </Grid>
  118. </annotview:StickyPopupExt>