CPDFStampUI.xaml 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. <UserControl x:Class="Compdfkit_Tools.Annotation.PDFAnnotationPanel.PDFAnnotationUI.CPDFStampUI"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. mc:Ignorable="d"
  7. Loaded="UserControl_Loaded"
  8. d:DesignHeight="450" d:DesignWidth="800">
  9. <UserControl.Resources>
  10. <ResourceDictionary>
  11. <ResourceDictionary.MergedDictionaries>
  12. <ResourceDictionary Source="../../../Asset/Styles/TabControlStyle.xaml"></ResourceDictionary>
  13. <ResourceDictionary Source="../../../Asset/Styles/TabItemStyle.xaml"></ResourceDictionary>
  14. </ResourceDictionary.MergedDictionaries>
  15. </ResourceDictionary>
  16. </UserControl.Resources>
  17. <Grid Background="#FAFCFF">
  18. <Grid.RowDefinitions>
  19. <RowDefinition Height="40"/>
  20. <RowDefinition Height="*"/>
  21. </Grid.RowDefinitions>
  22. <Border BorderThickness="1" BorderBrush="#1A000000">
  23. <Grid Height="40" Background="White" >
  24. <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Text="Stamp" FontSize="16" FontFamily="Segoe UI" FontWeight="Bold"/>
  25. </Grid>
  26. </Border>
  27. <TabControl Grid.Row="1" Style="{DynamicResource TabControlStyle1}" >
  28. <TabItem Height="32" Style="{DynamicResource TabItemStyle1}" Header="Standard">
  29. <ListBox
  30. x:Name="StandardListBox"
  31. VerticalAlignment="Top"
  32. Background="Transparent"
  33. BorderThickness="0"
  34. ScrollViewer.HorizontalScrollBarVisibility="Disabled">
  35. <ListBox.ItemTemplate>
  36. <DataTemplate>
  37. <Image
  38. Height="48"
  39. Source="{Binding SourcePath}"
  40. Stretch="Uniform" />
  41. </DataTemplate>
  42. </ListBox.ItemTemplate>
  43. <ListBox.ItemContainerStyle>
  44. <Style TargetType="ListBoxItem">
  45. <Setter Property="Height" Value="65" />
  46. <Setter Property="Padding" Value="8" />
  47. <Setter Property="HorizontalContentAlignment" Value="Center" />
  48. <Setter Property="Template">
  49. <Setter.Value>
  50. <ControlTemplate TargetType="{x:Type ListBoxItem}">
  51. <Border
  52. x:Name="Bd"
  53. Padding="{TemplateBinding Padding}"
  54. Background="{TemplateBinding Background}"
  55. BorderBrush="{TemplateBinding BorderBrush}"
  56. BorderThickness="{TemplateBinding BorderThickness}"
  57. SnapsToDevicePixels="true">
  58. <Grid>
  59. <ContentPresenter
  60. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  61. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  62. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  63. </Grid>
  64. </Border>
  65. <ControlTemplate.Triggers>
  66. <MultiTrigger>
  67. <MultiTrigger.Conditions>
  68. <Condition Property="IsMouseOver" Value="True" />
  69. </MultiTrigger.Conditions>
  70. <Setter TargetName="Bd" Property="Background" Value="#DDE9FF" />
  71. <Setter TargetName="Bd" Property="BorderBrush" Value="#DDE9FF" />
  72. </MultiTrigger>
  73. <MultiTrigger>
  74. <MultiTrigger.Conditions>
  75. <Condition Property="Selector.IsSelectionActive" Value="False" />
  76. <Condition Property="IsSelected" Value="True" />
  77. </MultiTrigger.Conditions>
  78. <Setter TargetName="Bd" Property="Background" Value="#DDE9FF" />
  79. <Setter TargetName="Bd" Property="BorderBrush" Value="#DDE9FF" />
  80. </MultiTrigger>
  81. <MultiTrigger>
  82. <MultiTrigger.Conditions>
  83. <Condition Property="Selector.IsSelectionActive" Value="True" />
  84. <Condition Property="IsSelected" Value="True" />
  85. </MultiTrigger.Conditions>
  86. <Setter TargetName="Bd" Property="Background" Value="#DDE9FF" />
  87. <Setter TargetName="Bd" Property="BorderBrush" Value="#DDE9FF" />
  88. </MultiTrigger>
  89. <Trigger Property="IsEnabled" Value="False">
  90. <Setter TargetName="Bd" Property="TextElement.Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
  91. </Trigger>
  92. </ControlTemplate.Triggers>
  93. </ControlTemplate>
  94. </Setter.Value>
  95. </Setter>
  96. <EventSetter Event="PreviewMouseLeftButtonDown" Handler="Standard_PreviewMouseLeftButtonDown" />
  97. </Style>
  98. </ListBox.ItemContainerStyle>
  99. </ListBox>
  100. </TabItem>
  101. <TabItem Height="32" Style="{DynamicResource TabItemStyle1}" Header="Custom">
  102. <Grid>
  103. <Grid.RowDefinitions>
  104. <RowDefinition Height="72"/>
  105. <RowDefinition Height="*"/>
  106. </Grid.RowDefinitions>
  107. <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
  108. <Button Background="#001A4E" Height="32" Width="114" Click="Text_Click">
  109. <StackPanel Orientation="Horizontal">
  110. <Path Fill="White" Width="16" Height="16" Data="M13 3V5.4074H11.8889V4.11111H8.55569V11.5444H9.72871V12.6555H6.27192V11.5444H7.44458V4.11111H4.11111V5.4074H3V3H13Z"/>
  111. <TextBlock Margin="4,0,0,0" Text="Text Stamp" Foreground="White" FontSize="14" FontFamily="Segoe UI" FontWeight="Regular"/>
  112. </StackPanel>
  113. </Button>
  114. <Button Background="#001A4E" Height="32" Width="114" Margin="8,0,0,0" Click="Image_Click">
  115. <StackPanel Orientation="Horizontal">
  116. <Path Fill="White" Width="16" Height="16" Data="M1 2.6001H15V13.4001H1V2.6001ZM13.8 3.80009H2.2V10.5677L4.63597 8.00009L8.05143 10.8001L9.89748 8.8543L13.7153 12.2001H13.8V3.80009ZM11.6 7.20009C12.2627 7.20009 12.8 6.66283 12.8 6.00009C12.8 5.33735 12.2627 4.80009 11.6 4.80009C10.9373 4.80009 10.4 5.33735 10.4 6.00009C10.4 6.66283 10.9373 7.20009 11.6 7.20009Z" />
  117. <TextBlock Margin="4,0,0,0" Text="Image Stamp" Foreground="White" FontSize="14" FontFamily="Segoe UI" FontWeight="Regular"/>
  118. </StackPanel>
  119. </Button>
  120. </StackPanel>
  121. <ListView
  122. x:Name="CustomListBox"
  123. VerticalAlignment="Top"
  124. Background="Transparent"
  125. BorderThickness="0" Grid.Row="1" ScrollViewer.HorizontalScrollBarVisibility="Disabled">
  126. <ListView.GroupStyle>
  127. <GroupStyle>
  128. <GroupStyle.HeaderTemplate>
  129. <DataTemplate>
  130. <Grid Background="#F2F2F2">
  131. <TextBlock Text="{Binding Name}" FontSize="14" FontFamily="Helvetica" FontWeight="Bold"/>
  132. </Grid>
  133. </DataTemplate>
  134. </GroupStyle.HeaderTemplate>
  135. <GroupStyle.Panel>
  136. <ItemsPanelTemplate>
  137. <VirtualizingStackPanel Visibility="Visible"/>
  138. </ItemsPanelTemplate>
  139. </GroupStyle.Panel>
  140. </GroupStyle>
  141. </ListView.GroupStyle>
  142. <ListView.ItemTemplate>
  143. <DataTemplate>
  144. <Image
  145. Height="40"
  146. Source="{Binding SourcePath}"
  147. Stretch="Uniform" />
  148. </DataTemplate>
  149. </ListView.ItemTemplate>
  150. <ListView.ItemContainerStyle>
  151. <Style TargetType="ListBoxItem">
  152. <Setter Property="Height" Value="65" />
  153. <Setter Property="Padding" Value="8" />
  154. <Setter Property="HorizontalContentAlignment" Value="Center" />
  155. <Setter Property="Template">
  156. <Setter.Value>
  157. <ControlTemplate TargetType="{x:Type ListBoxItem}">
  158. <Border
  159. x:Name="Bd"
  160. Padding="{TemplateBinding Padding}"
  161. Background="{TemplateBinding Background}"
  162. BorderBrush="{TemplateBinding BorderBrush}"
  163. BorderThickness="{TemplateBinding BorderThickness}"
  164. SnapsToDevicePixels="true">
  165. <Grid>
  166. <ContentPresenter
  167. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  168. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  169. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  170. <Button HorizontalAlignment="Right" VerticalAlignment="Top" x:Name="DeleteIcon" Width="20" Height="20" Background="Transparent" BorderThickness="0" Click="Delete_Click" Visibility="Hidden" >
  171. <Path Width="16" Height="16" Fill="#43474D" Data="M11.8572 12.5643C12.0525 12.7596 12.3691 12.7596 12.5643 12.5643C12.7596 12.3691 12.7596 12.0525 12.5643 11.8572L8.95809 8.25099L12.5643 4.64475C12.7596 4.44949 12.7596 4.1329 12.5643 3.93764C12.3691 3.74238 12.0525 3.74238 11.8572 3.93764L8.25099 7.54389L4.64473 3.93763C4.44946 3.74236 4.13288 3.74236 3.93762 3.93763C3.74236 4.13289 3.74236 4.44947 3.93762 4.64473L7.54388 8.25099L3.93763 11.8572C3.74237 12.0525 3.74237 12.3691 3.93763 12.5643C4.1329 12.7596 4.44948 12.7596 4.64474 12.5643L8.25099 8.9581L11.8572 12.5643Z"/>
  172. </Button>
  173. </Grid>
  174. </Border>
  175. <ControlTemplate.Triggers>
  176. <MultiTrigger>
  177. <MultiTrigger.Conditions>
  178. <Condition Property="IsMouseOver" Value="True" />
  179. </MultiTrigger.Conditions>
  180. <Setter TargetName="Bd" Property="Background" Value="#DDE9FF" />
  181. <Setter TargetName="Bd" Property="BorderBrush" Value="#DDE9FF" />
  182. <Setter TargetName="DeleteIcon" Property="Visibility" Value="Visible" />
  183. </MultiTrigger>
  184. <MultiTrigger>
  185. <MultiTrigger.Conditions>
  186. <Condition Property="Selector.IsSelectionActive" Value="False" />
  187. <Condition Property="IsSelected" Value="True" />
  188. </MultiTrigger.Conditions>
  189. <Setter TargetName="Bd" Property="Background" Value="#DDE9FF" />
  190. <Setter TargetName="Bd" Property="BorderBrush" Value="#DDE9FF" />
  191. </MultiTrigger>
  192. <MultiTrigger>
  193. <MultiTrigger.Conditions>
  194. <Condition Property="Selector.IsSelectionActive" Value="True" />
  195. <Condition Property="IsSelected" Value="True" />
  196. </MultiTrigger.Conditions>
  197. <Setter TargetName="Bd" Property="Background" Value="#DDE9FF" />
  198. <Setter TargetName="Bd" Property="BorderBrush" Value="#DDE9FF" />
  199. </MultiTrigger>
  200. <Trigger Property="IsEnabled" Value="False">
  201. <Setter TargetName="Bd" Property="TextElement.Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
  202. </Trigger>
  203. </ControlTemplate.Triggers>
  204. </ControlTemplate>
  205. </Setter.Value>
  206. </Setter>
  207. <EventSetter Event="PreviewMouseLeftButtonDown" Handler="Customize_PreviewMouseLeftButtonDown" />
  208. </Style>
  209. </ListView.ItemContainerStyle>
  210. </ListView>
  211. </Grid>
  212. </TabItem>
  213. </TabControl>
  214. </Grid>
  215. </UserControl>