CPDFStampUI.xaml 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  1. <UserControl x:Class="ComPDFKit.Controls.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. xmlns:common="clr-namespace:ComPDFKit.Controls.Common"
  7. mc:Ignorable="d"
  8. Loaded="UserControl_Loaded"
  9. d:DesignHeight="450" d:DesignWidth="800">
  10. <UserControl.Resources>
  11. <ResourceDictionary>
  12. <ResourceDictionary.MergedDictionaries>
  13. <ResourceDictionary Source="../../../Asset/Styles/TabControlStyle.xaml"></ResourceDictionary>
  14. <ResourceDictionary Source="../../../Asset/Styles/TabItemStyle.xaml"></ResourceDictionary>
  15. </ResourceDictionary.MergedDictionaries>
  16. <common:PropertyPanelResourceConverter x:Key="PropertyPanelResourceConverter"></common:PropertyPanelResourceConverter>
  17. </ResourceDictionary>
  18. </UserControl.Resources>
  19. <Grid Background="#FAFCFF">
  20. <Grid.RowDefinitions>
  21. <RowDefinition Height="40"/>
  22. <RowDefinition Height="*"/>
  23. </Grid.RowDefinitions>
  24. <Border BorderThickness="1" BorderBrush="#1A000000">
  25. <Grid Height="40" Background="White" >
  26. <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Text="{Binding Converter={StaticResource PropertyPanelResourceConverter},ConverterParameter=Title_Stamp}" FontSize="16" FontFamily="Microsoft YaHei" FontWeight="Bold"/>
  27. </Grid>
  28. </Border>
  29. <TabControl Grid.Row="1" Style="{DynamicResource TabControlStyle1}" >
  30. <TabItem Height="32" Style="{DynamicResource TabItemStyle1}" Header="{Binding Converter={StaticResource PropertyPanelResourceConverter},ConverterParameter=Stamp_Standard}">
  31. <ListBox
  32. x:Name="StandardListBox"
  33. VerticalAlignment="Top"
  34. Background="Transparent"
  35. BorderThickness="0"
  36. ScrollViewer.HorizontalScrollBarVisibility="Disabled">
  37. <ListBox.ItemTemplate>
  38. <DataTemplate>
  39. <Image
  40. Height="48"
  41. Source="{Binding SourcePath}"
  42. Stretch="Uniform" />
  43. </DataTemplate>
  44. </ListBox.ItemTemplate>
  45. <ListBox.ItemContainerStyle>
  46. <Style TargetType="ListBoxItem">
  47. <Setter Property="Height" Value="65" />
  48. <Setter Property="Padding" Value="8" />
  49. <Setter Property="HorizontalContentAlignment" Value="Center" />
  50. <Setter Property="Template">
  51. <Setter.Value>
  52. <ControlTemplate TargetType="{x:Type ListBoxItem}">
  53. <Border
  54. x:Name="Bd"
  55. Padding="{TemplateBinding Padding}"
  56. Background="{TemplateBinding Background}"
  57. BorderBrush="{TemplateBinding BorderBrush}"
  58. BorderThickness="{TemplateBinding BorderThickness}"
  59. SnapsToDevicePixels="true">
  60. <Grid>
  61. <ContentPresenter
  62. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  63. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  64. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  65. </Grid>
  66. </Border>
  67. <ControlTemplate.Triggers>
  68. <MultiTrigger>
  69. <MultiTrigger.Conditions>
  70. <Condition Property="IsMouseOver" Value="True" />
  71. </MultiTrigger.Conditions>
  72. <Setter TargetName="Bd" Property="Background" Value="#DDE9FF" />
  73. <Setter TargetName="Bd" Property="BorderBrush" Value="#DDE9FF" />
  74. </MultiTrigger>
  75. <MultiTrigger>
  76. <MultiTrigger.Conditions>
  77. <Condition Property="Selector.IsSelectionActive" Value="False" />
  78. <Condition Property="IsSelected" Value="True" />
  79. </MultiTrigger.Conditions>
  80. <Setter TargetName="Bd" Property="Background" Value="#DDE9FF" />
  81. <Setter TargetName="Bd" Property="BorderBrush" Value="#DDE9FF" />
  82. </MultiTrigger>
  83. <MultiTrigger>
  84. <MultiTrigger.Conditions>
  85. <Condition Property="Selector.IsSelectionActive" Value="True" />
  86. <Condition Property="IsSelected" Value="True" />
  87. </MultiTrigger.Conditions>
  88. <Setter TargetName="Bd" Property="Background" Value="#DDE9FF" />
  89. <Setter TargetName="Bd" Property="BorderBrush" Value="#DDE9FF" />
  90. </MultiTrigger>
  91. <Trigger Property="IsEnabled" Value="False">
  92. <Setter TargetName="Bd" Property="TextElement.Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
  93. </Trigger>
  94. </ControlTemplate.Triggers>
  95. </ControlTemplate>
  96. </Setter.Value>
  97. </Setter>
  98. <EventSetter Event="PreviewMouseLeftButtonDown" Handler="Standard_PreviewMouseLeftButtonDown" />
  99. </Style>
  100. </ListBox.ItemContainerStyle>
  101. </ListBox>
  102. </TabItem>
  103. <TabItem Height="32" Style="{DynamicResource TabItemStyle1}" Header="{Binding Converter={StaticResource PropertyPanelResourceConverter},ConverterParameter=Stamp_Custom}">
  104. <Grid>
  105. <Grid.RowDefinitions>
  106. <RowDefinition Height="72"/>
  107. <RowDefinition Height="*"/>
  108. </Grid.RowDefinitions>
  109. <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
  110. <Button Background="#001A4E" Height="32" Width="114" Click="Text_Click">
  111. <StackPanel Orientation="Horizontal">
  112. <Path Fill="White" Width="16" Height="16" Data="M13 3V5.4074H11.8889V4.11111H8.55569V11.5444H9.72871V12.6555H6.27192V11.5444H7.44458V4.11111H4.11111V5.4074H3V3H13Z"/>
  113. <TextBlock Margin="4,0,0,0" Text="{Binding Converter={StaticResource PropertyPanelResourceConverter},ConverterParameter=Custom_Text}" Foreground="White" FontSize="14" FontFamily="Microsoft YaHei" FontWeight="Regular"/>
  114. </StackPanel>
  115. </Button>
  116. <Button Background="#001A4E" Height="32" Width="114" Margin="8,0,0,0" Click="Image_Click">
  117. <StackPanel Orientation="Horizontal">
  118. <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" />
  119. <TextBlock Margin="4,0,0,0" Text="{Binding Converter={StaticResource PropertyPanelResourceConverter},ConverterParameter=Custom_Image}" Foreground="White" FontSize="14" FontFamily="Microsoft YaHei" FontWeight="Regular"/>
  120. </StackPanel>
  121. </Button>
  122. </StackPanel>
  123. <ListView
  124. x:Name="CustomListBox"
  125. VerticalAlignment="Top"
  126. Background="Transparent"
  127. BorderThickness="0" Grid.Row="1" ScrollViewer.HorizontalScrollBarVisibility="Disabled">
  128. <ListView.GroupStyle>
  129. <GroupStyle>
  130. <GroupStyle.HeaderTemplate>
  131. <DataTemplate>
  132. <Grid Background="#F2F2F2">
  133. <TextBlock Text="{Binding Name}" FontSize="14" FontFamily="Helvetica" FontWeight="Bold"/>
  134. </Grid>
  135. </DataTemplate>
  136. </GroupStyle.HeaderTemplate>
  137. <GroupStyle.Panel>
  138. <ItemsPanelTemplate>
  139. <VirtualizingStackPanel Visibility="Visible"/>
  140. </ItemsPanelTemplate>
  141. </GroupStyle.Panel>
  142. </GroupStyle>
  143. </ListView.GroupStyle>
  144. <ListView.ItemTemplate>
  145. <DataTemplate>
  146. <Image
  147. Height="40"
  148. Source="{Binding SourcePath}"
  149. Stretch="Uniform" />
  150. </DataTemplate>
  151. </ListView.ItemTemplate>
  152. <ListView.ItemContainerStyle>
  153. <Style TargetType="ListBoxItem">
  154. <Setter Property="Height" Value="65" />
  155. <Setter Property="Padding" Value="8" />
  156. <Setter Property="HorizontalContentAlignment" Value="Center" />
  157. <Setter Property="Template">
  158. <Setter.Value>
  159. <ControlTemplate TargetType="{x:Type ListBoxItem}">
  160. <Border
  161. x:Name="Bd"
  162. Padding="{TemplateBinding Padding}"
  163. Background="{TemplateBinding Background}"
  164. BorderBrush="{TemplateBinding BorderBrush}"
  165. BorderThickness="{TemplateBinding BorderThickness}"
  166. SnapsToDevicePixels="true">
  167. <Grid>
  168. <ContentPresenter
  169. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  170. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  171. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  172. <Button HorizontalAlignment="Right" VerticalAlignment="Top" x:Name="DeleteIcon" Width="20" Height="20" Background="Transparent" BorderThickness="0" Click="Delete_Click" Visibility="Hidden" >
  173. <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"/>
  174. </Button>
  175. </Grid>
  176. </Border>
  177. <ControlTemplate.Triggers>
  178. <MultiTrigger>
  179. <MultiTrigger.Conditions>
  180. <Condition Property="IsMouseOver" Value="True" />
  181. </MultiTrigger.Conditions>
  182. <Setter TargetName="Bd" Property="Background" Value="#DDE9FF" />
  183. <Setter TargetName="Bd" Property="BorderBrush" Value="#DDE9FF" />
  184. <Setter TargetName="DeleteIcon" Property="Visibility" Value="Visible" />
  185. </MultiTrigger>
  186. <MultiTrigger>
  187. <MultiTrigger.Conditions>
  188. <Condition Property="Selector.IsSelectionActive" Value="False" />
  189. <Condition Property="IsSelected" Value="True" />
  190. </MultiTrigger.Conditions>
  191. <Setter TargetName="Bd" Property="Background" Value="#DDE9FF" />
  192. <Setter TargetName="Bd" Property="BorderBrush" Value="#DDE9FF" />
  193. </MultiTrigger>
  194. <MultiTrigger>
  195. <MultiTrigger.Conditions>
  196. <Condition Property="Selector.IsSelectionActive" Value="True" />
  197. <Condition Property="IsSelected" Value="True" />
  198. </MultiTrigger.Conditions>
  199. <Setter TargetName="Bd" Property="Background" Value="#DDE9FF" />
  200. <Setter TargetName="Bd" Property="BorderBrush" Value="#DDE9FF" />
  201. </MultiTrigger>
  202. <Trigger Property="IsEnabled" Value="False">
  203. <Setter TargetName="Bd" Property="TextElement.Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
  204. </Trigger>
  205. </ControlTemplate.Triggers>
  206. </ControlTemplate>
  207. </Setter.Value>
  208. </Setter>
  209. <EventSetter Event="PreviewMouseLeftButtonDown" Handler="Customize_PreviewMouseLeftButtonDown" />
  210. </Style>
  211. </ListView.ItemContainerStyle>
  212. </ListView>
  213. </Grid>
  214. </TabItem>
  215. </TabControl>
  216. </Grid>
  217. </UserControl>