CPDFCreateSignatureDialog.xaml 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442
  1. <Window x:Class="ComPDFKit.Controls.Annotation.PDFAnnotationPanel.PDFAnnotationUI.CPDFCreateSignatureDialog"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  5. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  6. xmlns:convert="clr-namespace:ComPDFKit.Controls.Common"
  7. xmlns:common="clr-namespace:ComPDFKit.Controls.Common"
  8. mc:Ignorable="d"
  9. AllowsTransparency="True"
  10. WindowStyle="None"
  11. Loaded="Window_Loaded"
  12. Title="CreateSignatureDialog" Height="422" Width="626" BorderThickness="1" BorderBrush="#5A000000">
  13. <Window.Resources>
  14. <ResourceDictionary>
  15. <ResourceDictionary.MergedDictionaries>
  16. <ResourceDictionary Source="../../../Asset/Styles/ButtonStyle.xaml"></ResourceDictionary>
  17. <ResourceDictionary Source="../../../Asset/Styles/ComboBoxStyle.xaml"></ResourceDictionary>
  18. </ResourceDictionary.MergedDictionaries>
  19. <convert:PropertyPanelResourceConverter x:Key="PropertyPanelResourceConverter"></convert:PropertyPanelResourceConverter>
  20. <convert:ReverseVisibilityConverter x:Key="ReverseVisibilityConverter"/>
  21. <SolidColorBrush x:Key="TabItem.Selected.Background" Color="#FFFFFF"/>
  22. <SolidColorBrush x:Key="TabItem.Selected.Border" Color="#ACACAC"/>
  23. <Style x:Key="TabControlStyle1" TargetType="{x:Type TabControl}">
  24. <Setter Property="Padding" Value="2"/>
  25. <Setter Property="HorizontalContentAlignment" Value="Center"/>
  26. <Setter Property="VerticalContentAlignment" Value="Center"/>
  27. <Setter Property="Background" Value="{StaticResource TabItem.Selected.Background}"/>
  28. <Setter Property="BorderBrush" Value="{StaticResource TabItem.Selected.Border}"/>
  29. <Setter Property="BorderThickness" Value="0"/>
  30. <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
  31. <Setter Property="Template">
  32. <Setter.Value>
  33. <ControlTemplate TargetType="{x:Type TabControl}">
  34. <Grid x:Name="templateRoot" ClipToBounds="true" SnapsToDevicePixels="true" KeyboardNavigation.TabNavigation="Local">
  35. <Grid.ColumnDefinitions>
  36. <ColumnDefinition x:Name="ColumnDefinition0"/>
  37. <ColumnDefinition x:Name="ColumnDefinition1" Width="0"/>
  38. </Grid.ColumnDefinitions>
  39. <Grid.RowDefinitions>
  40. <RowDefinition x:Name="RowDefinition0" Height="Auto"/>
  41. <RowDefinition x:Name="RowDefinition1" Height="*"/>
  42. </Grid.RowDefinitions>
  43. <TabPanel x:Name="headerPanel" Background="Transparent" Grid.Column="0" IsItemsHost="true" Margin="2" Grid.Row="0" KeyboardNavigation.TabIndex="1" Panel.ZIndex="1"/>
  44. <Border x:Name="contentPanel" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Grid.Column="0" KeyboardNavigation.DirectionalNavigation="Contained" Grid.Row="1" KeyboardNavigation.TabIndex="2" KeyboardNavigation.TabNavigation="Local">
  45. <ContentPresenter x:Name="PART_SelectedContentHost" ContentSource="SelectedContent" Margin="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
  46. </Border>
  47. </Grid>
  48. <ControlTemplate.Triggers>
  49. <Trigger Property="TabStripPlacement" Value="Bottom">
  50. <Setter Property="Grid.Row" TargetName="headerPanel" Value="1"/>
  51. <Setter Property="Grid.Row" TargetName="contentPanel" Value="0"/>
  52. <Setter Property="Height" TargetName="RowDefinition0" Value="*"/>
  53. <Setter Property="Height" TargetName="RowDefinition1" Value="Auto"/>
  54. <Setter Property="Margin" TargetName="headerPanel" Value="2,0,2,2"/>
  55. </Trigger>
  56. <Trigger Property="TabStripPlacement" Value="Left">
  57. <Setter Property="Grid.Row" TargetName="headerPanel" Value="0"/>
  58. <Setter Property="Grid.Row" TargetName="contentPanel" Value="0"/>
  59. <Setter Property="Grid.Column" TargetName="headerPanel" Value="0"/>
  60. <Setter Property="Grid.Column" TargetName="contentPanel" Value="1"/>
  61. <Setter Property="Width" TargetName="ColumnDefinition0" Value="Auto"/>
  62. <Setter Property="Width" TargetName="ColumnDefinition1" Value="*"/>
  63. <Setter Property="Height" TargetName="RowDefinition0" Value="*"/>
  64. <Setter Property="Height" TargetName="RowDefinition1" Value="0"/>
  65. <Setter Property="Margin" TargetName="headerPanel" Value="2,2,0,2"/>
  66. </Trigger>
  67. <Trigger Property="TabStripPlacement" Value="Right">
  68. <Setter Property="Grid.Row" TargetName="headerPanel" Value="0"/>
  69. <Setter Property="Grid.Row" TargetName="contentPanel" Value="0"/>
  70. <Setter Property="Grid.Column" TargetName="headerPanel" Value="1"/>
  71. <Setter Property="Grid.Column" TargetName="contentPanel" Value="0"/>
  72. <Setter Property="Width" TargetName="ColumnDefinition0" Value="*"/>
  73. <Setter Property="Width" TargetName="ColumnDefinition1" Value="Auto"/>
  74. <Setter Property="Height" TargetName="RowDefinition0" Value="*"/>
  75. <Setter Property="Height" TargetName="RowDefinition1" Value="0"/>
  76. <Setter Property="Margin" TargetName="headerPanel" Value="0,2,2,2"/>
  77. </Trigger>
  78. <Trigger Property="IsEnabled" Value="false">
  79. <Setter Property="TextElement.Foreground" TargetName="templateRoot" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
  80. </Trigger>
  81. </ControlTemplate.Triggers>
  82. </ControlTemplate>
  83. </Setter.Value>
  84. </Setter>
  85. </Style>
  86. <Style x:Key="FocusVisual">
  87. <Setter Property="Control.Template">
  88. <Setter.Value>
  89. <ControlTemplate>
  90. <Rectangle Margin="2" StrokeDashArray="1 2" Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" SnapsToDevicePixels="true" StrokeThickness="1"/>
  91. </ControlTemplate>
  92. </Setter.Value>
  93. </Setter>
  94. </Style>
  95. <LinearGradientBrush x:Key="TabItem.Static.Background" EndPoint="0,1" StartPoint="0,0">
  96. <GradientStop Color="#F0F0F0" Offset="0.0"/>
  97. <GradientStop Color="#E5E5E5" Offset="1.0"/>
  98. </LinearGradientBrush>
  99. <SolidColorBrush x:Key="TabItem.Static.Border" Color="#ACACAC"/>
  100. <LinearGradientBrush x:Key="TabItem.MouseOver.Background" EndPoint="0,1" StartPoint="0,0">
  101. <GradientStop Color="#ECF4FC" Offset="0.0"/>
  102. <GradientStop Color="#DCECFC" Offset="1.0"/>
  103. </LinearGradientBrush>
  104. <SolidColorBrush x:Key="TabItem.MouseOver.Border" Color="#7EB4EA"/>
  105. <SolidColorBrush x:Key="TabItem.Selected.Background1" Color="#FFFFFF"/>
  106. <SolidColorBrush x:Key="TabItem.Selected.Border1" Color="#1460F3"/>
  107. <SolidColorBrush x:Key="TabItem.Disabled.Background" Color="#F0F0F0"/>
  108. <SolidColorBrush x:Key="TabItem.Disabled.Border" Color="#FFFFFF"/>
  109. <Style x:Key="TabItemStyle1" TargetType="{x:Type TabItem}">
  110. <Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual}"/>
  111. <Setter Property="Foreground" Value="Black"/>
  112. <Setter Property="Background" Value="{StaticResource TabItem.Static.Background}"/>
  113. <Setter Property="BorderBrush" Value="{StaticResource TabItem.Static.Border}"/>
  114. <Setter Property="Margin" Value="0"/>
  115. <Setter Property="Padding" Value="6,2,6,2"/>
  116. <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
  117. <Setter Property="VerticalContentAlignment" Value="Stretch"/>
  118. <Setter Property="Template">
  119. <Setter.Value>
  120. <ControlTemplate TargetType="{x:Type TabItem}">
  121. <Grid x:Name="templateRoot" SnapsToDevicePixels="true">
  122. <Border x:Name="mainBorder" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="0,0,0,1" Margin="0">
  123. <Border x:Name="innerBorder" Background="{StaticResource TabItem.Selected.Background1}" BorderBrush="{StaticResource TabItem.Selected.Border1}" BorderThickness="0,0,0,1" Margin="-1" Opacity="0"/>
  124. </Border>
  125. <ContentPresenter x:Name="contentPresenter" ContentSource="Header" Focusable="False" HorizontalAlignment="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{Binding VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
  126. </Grid>
  127. <ControlTemplate.Triggers>
  128. <MultiDataTrigger>
  129. <MultiDataTrigger.Conditions>
  130. <Condition Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}" Value="true"/>
  131. <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Left"/>
  132. </MultiDataTrigger.Conditions>
  133. <Setter Property="Background" TargetName="mainBorder" Value="{StaticResource TabItem.MouseOver.Background}"/>
  134. <Setter Property="BorderBrush" TargetName="mainBorder" Value="{StaticResource TabItem.MouseOver.Border}"/>
  135. <Setter Property="BorderThickness" TargetName="innerBorder" Value="0,0,0,1"/>
  136. <Setter Property="BorderThickness" TargetName="mainBorder" Value="0,0,0,1"/>
  137. </MultiDataTrigger>
  138. <MultiDataTrigger>
  139. <MultiDataTrigger.Conditions>
  140. <Condition Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}" Value="true"/>
  141. <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Bottom"/>
  142. </MultiDataTrigger.Conditions>
  143. <Setter Property="Background" TargetName="mainBorder" Value="{StaticResource TabItem.MouseOver.Background}"/>
  144. <Setter Property="BorderBrush" TargetName="mainBorder" Value="{StaticResource TabItem.MouseOver.Border}"/>
  145. <Setter Property="BorderThickness" TargetName="innerBorder" Value="0,0,0,1"/>
  146. <Setter Property="BorderThickness" TargetName="mainBorder" Value="0,0,0,1"/>
  147. </MultiDataTrigger>
  148. <MultiDataTrigger>
  149. <MultiDataTrigger.Conditions>
  150. <Condition Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}" Value="true"/>
  151. <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Right"/>
  152. </MultiDataTrigger.Conditions>
  153. <Setter Property="Background" TargetName="mainBorder" Value="{StaticResource TabItem.MouseOver.Background}"/>
  154. <Setter Property="BorderBrush" TargetName="mainBorder" Value="{StaticResource TabItem.MouseOver.Border}"/>
  155. <Setter Property="BorderThickness" TargetName="innerBorder" Value="0,0,0,1"/>
  156. <Setter Property="BorderThickness" TargetName="mainBorder" Value="0,0,0,1"/>
  157. </MultiDataTrigger>
  158. <MultiDataTrigger>
  159. <MultiDataTrigger.Conditions>
  160. <Condition Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}" Value="true"/>
  161. <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Top"/>
  162. </MultiDataTrigger.Conditions>
  163. <Setter Property="Background" TargetName="mainBorder" Value="{StaticResource TabItem.MouseOver.Background}"/>
  164. <Setter Property="BorderBrush" TargetName="mainBorder" Value="{StaticResource TabItem.MouseOver.Border}"/>
  165. <Setter Property="BorderThickness" TargetName="innerBorder" Value="0,0,0,1"/>
  166. <Setter Property="BorderThickness" TargetName="mainBorder" Value="0,0,0,1"/>
  167. </MultiDataTrigger>
  168. <MultiDataTrigger>
  169. <MultiDataTrigger.Conditions>
  170. <Condition Binding="{Binding IsEnabled, RelativeSource={RelativeSource Self}}" Value="false"/>
  171. <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Left"/>
  172. </MultiDataTrigger.Conditions>
  173. <Setter Property="Opacity" TargetName="contentPresenter" Value="0.56"/>
  174. <Setter Property="Background" TargetName="mainBorder" Value="{StaticResource TabItem.Disabled.Background}"/>
  175. <Setter Property="BorderBrush" TargetName="mainBorder" Value="{StaticResource TabItem.Disabled.Border}"/>
  176. <Setter Property="BorderThickness" TargetName="innerBorder" Value="0,0,0,0"/>
  177. <Setter Property="BorderThickness" TargetName="mainBorder" Value="0,0,0,0"/>
  178. </MultiDataTrigger>
  179. <MultiDataTrigger>
  180. <MultiDataTrigger.Conditions>
  181. <Condition Binding="{Binding IsEnabled, RelativeSource={RelativeSource Self}}" Value="false"/>
  182. <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Bottom"/>
  183. </MultiDataTrigger.Conditions>
  184. <Setter Property="Opacity" TargetName="contentPresenter" Value="0.56"/>
  185. <Setter Property="Background" TargetName="mainBorder" Value="{StaticResource TabItem.Disabled.Background}"/>
  186. <Setter Property="BorderBrush" TargetName="mainBorder" Value="{StaticResource TabItem.Disabled.Border}"/>
  187. <Setter Property="BorderThickness" TargetName="innerBorder" Value="0,0,0,0"/>
  188. <Setter Property="BorderThickness" TargetName="mainBorder" Value="0,0,0,0"/>
  189. </MultiDataTrigger>
  190. <MultiDataTrigger>
  191. <MultiDataTrigger.Conditions>
  192. <Condition Binding="{Binding IsEnabled, RelativeSource={RelativeSource Self}}" Value="false"/>
  193. <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Right"/>
  194. </MultiDataTrigger.Conditions>
  195. <Setter Property="Opacity" TargetName="contentPresenter" Value="0.56"/>
  196. <Setter Property="Background" TargetName="mainBorder" Value="{StaticResource TabItem.Disabled.Background}"/>
  197. <Setter Property="BorderBrush" TargetName="mainBorder" Value="{StaticResource TabItem.Disabled.Border}"/>
  198. <Setter Property="BorderThickness" TargetName="innerBorder" Value="0,0,0,0"/>
  199. <Setter Property="BorderThickness" TargetName="mainBorder" Value="0,0,0,0"/>
  200. </MultiDataTrigger>
  201. <MultiDataTrigger>
  202. <MultiDataTrigger.Conditions>
  203. <Condition Binding="{Binding IsEnabled, RelativeSource={RelativeSource Self}}" Value="false"/>
  204. <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Top"/>
  205. </MultiDataTrigger.Conditions>
  206. <Setter Property="Opacity" TargetName="contentPresenter" Value="0.56"/>
  207. <Setter Property="Background" TargetName="mainBorder" Value="{StaticResource TabItem.Disabled.Background}"/>
  208. <Setter Property="BorderBrush" TargetName="mainBorder" Value="{StaticResource TabItem.Disabled.Border}"/>
  209. <Setter Property="BorderThickness" TargetName="innerBorder" Value="0,0,0,0"/>
  210. <Setter Property="BorderThickness" TargetName="mainBorder" Value="0,0,0,0"/>
  211. </MultiDataTrigger>
  212. <MultiDataTrigger>
  213. <MultiDataTrigger.Conditions>
  214. <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="false"/>
  215. <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Left"/>
  216. </MultiDataTrigger.Conditions>
  217. <Setter Property="Opacity" TargetName="innerBorder" Value="1"/>
  218. <Setter Property="BorderThickness" TargetName="innerBorder" Value="0,0,0,0"/>
  219. <Setter Property="BorderThickness" TargetName="mainBorder" Value="0,0,0,0"/>
  220. </MultiDataTrigger>
  221. <MultiDataTrigger>
  222. <MultiDataTrigger.Conditions>
  223. <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="true"/>
  224. <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Left"/>
  225. </MultiDataTrigger.Conditions>
  226. <Setter Property="Panel.ZIndex" Value="1"/>
  227. <Setter Property="Margin" Value="-2,-2,0,-2"/>
  228. <Setter Property="Opacity" TargetName="innerBorder" Value="1"/>
  229. <Setter Property="BorderThickness" TargetName="innerBorder" Value="0,0,0,1"/>
  230. <Setter Property="BorderThickness" TargetName="mainBorder" Value="0,0,0,1"/>
  231. </MultiDataTrigger>
  232. <MultiDataTrigger>
  233. <MultiDataTrigger.Conditions>
  234. <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="false"/>
  235. <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Bottom"/>
  236. </MultiDataTrigger.Conditions>
  237. <Setter Property="Opacity" TargetName="innerBorder" Value="1"/>
  238. <Setter Property="BorderThickness" TargetName="innerBorder" Value="0,0,0,0"/>
  239. <Setter Property="BorderThickness" TargetName="mainBorder" Value="0,0,0,0"/>
  240. </MultiDataTrigger>
  241. <MultiDataTrigger>
  242. <MultiDataTrigger.Conditions>
  243. <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="true"/>
  244. <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Bottom"/>
  245. </MultiDataTrigger.Conditions>
  246. <Setter Property="Panel.ZIndex" Value="1"/>
  247. <Setter Property="Margin" Value="-2,0,-2,-2"/>
  248. <Setter Property="Opacity" TargetName="innerBorder" Value="1"/>
  249. <Setter Property="BorderThickness" TargetName="innerBorder" Value="0,0,0,1"/>
  250. <Setter Property="BorderThickness" TargetName="mainBorder" Value="0,0,0,1"/>
  251. </MultiDataTrigger>
  252. <MultiDataTrigger>
  253. <MultiDataTrigger.Conditions>
  254. <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="false"/>
  255. <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Right"/>
  256. </MultiDataTrigger.Conditions>
  257. <Setter Property="Opacity" TargetName="innerBorder" Value="1"/>
  258. <Setter Property="BorderThickness" TargetName="innerBorder" Value="0,0,0,0"/>
  259. <Setter Property="BorderThickness" TargetName="mainBorder" Value="0,0,0,0"/>
  260. </MultiDataTrigger>
  261. <MultiDataTrigger>
  262. <MultiDataTrigger.Conditions>
  263. <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="true"/>
  264. <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Right"/>
  265. </MultiDataTrigger.Conditions>
  266. <Setter Property="Panel.ZIndex" Value="1"/>
  267. <Setter Property="Margin" Value="0,-2,-2,-2"/>
  268. <Setter Property="Opacity" TargetName="innerBorder" Value="1"/>
  269. <Setter Property="BorderThickness" TargetName="innerBorder" Value="0,0,0,1"/>
  270. <Setter Property="BorderThickness" TargetName="mainBorder" Value="0,0,0,1"/>
  271. </MultiDataTrigger>
  272. <MultiDataTrigger>
  273. <MultiDataTrigger.Conditions>
  274. <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="false"/>
  275. <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Top"/>
  276. </MultiDataTrigger.Conditions>
  277. <Setter Property="Opacity" TargetName="innerBorder" Value="1"/>
  278. <Setter Property="BorderThickness" TargetName="innerBorder" Value="0,0,0,0"/>
  279. <Setter Property="BorderThickness" TargetName="mainBorder" Value="0,0,0,0"/>
  280. </MultiDataTrigger>
  281. <MultiDataTrigger>
  282. <MultiDataTrigger.Conditions>
  283. <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="true"/>
  284. <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Top"/>
  285. </MultiDataTrigger.Conditions>
  286. <Setter Property="Panel.ZIndex" Value="1"/>
  287. <Setter Property="Margin" Value="-2,-2,-2,0"/>
  288. <Setter Property="Opacity" TargetName="innerBorder" Value="1"/>
  289. <Setter Property="BorderThickness" TargetName="innerBorder" Value="0,0,0,1"/>
  290. <Setter Property="BorderThickness" TargetName="mainBorder" Value="0,0,0,1"/>
  291. </MultiDataTrigger>
  292. </ControlTemplate.Triggers>
  293. </ControlTemplate>
  294. </Setter.Value>
  295. </Setter>
  296. </Style>
  297. <Style x:Key="LinkButton" TargetType="Button">
  298. <Setter Property="Width" Value="Auto"/>
  299. <Setter Property="Template">
  300. <Setter.Value>
  301. <ControlTemplate TargetType="Button">
  302. <ContentPresenter Content="{TemplateBinding Content}"
  303. ContentTemplate="{TemplateBinding ContentTemplate}"
  304. VerticalAlignment="Center"
  305. >
  306. <ContentPresenter.Resources>
  307. <Style TargetType="{x:Type TextBlock}">
  308. <Setter Property="TextDecorations" Value="Underline" />
  309. </Style>
  310. </ContentPresenter.Resources>
  311. </ContentPresenter>
  312. </ControlTemplate>
  313. </Setter.Value>
  314. </Setter>
  315. <Setter Property="Foreground" Value="Blue" />
  316. <Setter Property="Cursor" Value="Hand" />
  317. <Style.Triggers>
  318. <Trigger Property="IsMouseOver" Value="true">
  319. <Setter Property="Foreground" Value="Red" />
  320. </Trigger>
  321. </Style.Triggers>
  322. </Style>
  323. </ResourceDictionary>
  324. </Window.Resources>
  325. <Grid>
  326. <Grid.RowDefinitions>
  327. <RowDefinition Height="26"/>
  328. <RowDefinition Height="*"/>
  329. <RowDefinition Height="41"/>
  330. <RowDefinition Height="11"/>
  331. </Grid.RowDefinitions>
  332. <TabControl Margin="23,0,23,0" Grid.Row="1" x:Name="CreateSignatureControl" SelectionChanged="CreateSignatureControl_SelectionChanged" Style="{DynamicResource TabControlStyle1}">
  333. <TabItem Style="{DynamicResource TabItemStyle1}" x:Name="InputItem" Header="{Binding Converter={StaticResource PropertyPanelResourceConverter},ConverterParameter=Button_Trackpad}">
  334. <Grid>
  335. <Grid.RowDefinitions>
  336. <RowDefinition Height="11" />
  337. <RowDefinition Height="240" />
  338. <RowDefinition Height="14" />
  339. <RowDefinition Height="32" />
  340. </Grid.RowDefinitions>
  341. <Grid Grid.Column="1" Grid.Row="1">
  342. <InkCanvas x:Name="DrawinkCanvas" Loaded="DrawinkCanvas_Loaded" Unloaded="DrawinkCanvas_Unloaded" Background="#F2F3F5" Grid.ColumnSpan="2" Margin="0,0,0,-10" />
  343. </Grid>
  344. <StackPanel Grid.Row="3" Grid.Column="2" VerticalAlignment="Center" Orientation="Horizontal">
  345. <TextBlock Text="{Binding Converter={StaticResource PropertyPanelResourceConverter},ConverterParameter=Property_LineWidth}" VerticalAlignment="Center" />
  346. <Slider x:Name="StrokeWidthSlider" Width="96" Margin="12,0,0,0" Value="4" Minimum="1" IsSnapToTickEnabled="True" Maximum="10" VerticalAlignment="Center" ValueChanged="StrokeWidth_ValueChanged"/>
  347. <TextBox Text="{Binding ElementName=StrokeWidthSlider, Path=Value,Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Width="72" Height="32" VerticalContentAlignment="Center" TextChanged="TextBox_TextChanged"/>
  348. </StackPanel>
  349. <StackPanel
  350. Grid.Row="3"
  351. Grid.Column="2"
  352. HorizontalAlignment="Right"
  353. VerticalAlignment="Center"
  354. Orientation="Horizontal">
  355. <common:ColorPickerControl x:Name="ColorPickerControl" Loaded="ColorPickerControl_Loaded" ColorChanged="ColorPickerControl_ColorChanged" TransparentBtnProperty="Collapsed"></common:ColorPickerControl>
  356. </StackPanel>
  357. </Grid>
  358. </TabItem>
  359. <TabItem Header="{Binding Converter={StaticResource PropertyPanelResourceConverter},ConverterParameter=Button_Keyboard}" Style="{DynamicResource TabItemStyle1}">
  360. <Grid>
  361. <Grid.RowDefinitions>
  362. <RowDefinition Height="11" />
  363. <RowDefinition Height="240" />
  364. <RowDefinition Height="14" />
  365. <RowDefinition Height="32" />
  366. </Grid.RowDefinitions>
  367. <TextBox
  368. x:Name="InPutTextBox"
  369. TextChanged="InPutTextBox_TextChanged" Grid.Row="1"
  370. BorderThickness="0"
  371. Background="#F2F3F5"
  372. HorizontalContentAlignment="Center"
  373. VerticalContentAlignment="Center" Grid.ColumnSpan="2"
  374. FontSize="45"/>
  375. <StackPanel Grid.Row="3" Orientation="Horizontal" Grid.ColumnSpan="2">
  376. <TextBlock Text="{Binding Converter={StaticResource PropertyPanelResourceConverter},ConverterParameter=Property_Font}" VerticalAlignment="Center"/>
  377. <ComboBox Width="200" Name="FontNameCmb"
  378. Height="25"
  379. Style="{StaticResource ComboBoxStyle1}"
  380. Margin="8,0,0,0"
  381. SelectionChanged="FontNameCmb_SelectionChanged"
  382. SelectedIndex="0"
  383. HorizontalAlignment="Left"
  384. VerticalAlignment="Center">
  385. </ComboBox>
  386. <TextBlock Text="样式" VerticalAlignment="Center" Margin="10,0,8,0"/>
  387. <ComboBox x:Name="StyleNameCmb" Style="{StaticResource ComboBoxStyle1}" Height="25" Width="80" Margin="10,0,0,0" SelectionChanged="StyleNameCmb_SelectionChanged">
  388. <ComboBoxItem Content="Regular"></ComboBoxItem>
  389. <ComboBoxItem Content="Bold"></ComboBoxItem>
  390. <ComboBoxItem Content="Oblique"></ComboBoxItem>
  391. <ComboBoxItem Content="BoldOblique"></ComboBoxItem>
  392. </ComboBox>
  393. </StackPanel>
  394. <StackPanel
  395. Grid.Row="3"
  396. Grid.Column="1"
  397. HorizontalAlignment="Right"
  398. VerticalAlignment="Center"
  399. Orientation="Horizontal">
  400. <common:ColorPickerControl x:Name="TextColorPickerControl" Loaded="TextColorPickerControl_Loaded" ColorChanged="TextColorPickerControl_ColorChanged" TransparentBtnProperty="Collapsed"></common:ColorPickerControl>
  401. </StackPanel>
  402. </Grid>
  403. </TabItem>
  404. <TabItem Header="{Binding Converter={StaticResource PropertyPanelResourceConverter},ConverterParameter=Button_Image}" Style="{DynamicResource TabItemStyle1}">
  405. <Grid
  406. AllowDrop="True"
  407. PreviewDrop="Grid_Drop"
  408. >
  409. <Grid.RowDefinitions>
  410. <RowDefinition Height="11" />
  411. <RowDefinition Height="240" />
  412. <RowDefinition Height="14" />
  413. <RowDefinition Height="32" />
  414. </Grid.RowDefinitions>
  415. <Grid Background="#F2F3F5" Grid.Row="1">
  416. <Grid.RowDefinitions>
  417. <RowDefinition Height="182"/>
  418. <RowDefinition Height="20"/>
  419. <RowDefinition Height="38"/>
  420. </Grid.RowDefinitions>
  421. <StackPanel x:Name="AddImageBackground" VerticalAlignment="Bottom">
  422. <Image Height="112" Width="112" Source="pack://application:,,,/ComPDFKit.Controls;component/Asset/Resource/Annotation/Signature/Dropimage.png"/>
  423. <TextBlock Text="{Binding Converter={StaticResource PropertyPanelResourceConverter},ConverterParameter=Text_DropImage}" HorizontalAlignment="Center"/>
  424. <Button Style="{DynamicResource LinkButton}" HorizontalAlignment="Center" Content="{Binding Converter={StaticResource PropertyPanelResourceConverter},ConverterParameter=Link_SelectFile}" Click="OpenImage_Click"/>
  425. </StackPanel>
  426. <Image x:Name="ImageImage" SourceUpdated="ImageImage_SourceUpdated" Grid.RowSpan="3" HorizontalAlignment="Center" VerticalAlignment="Center" Grid.ColumnSpan="4" Visibility="{Binding ElementName=AddImageBackground,Path=Visibility, Converter={StaticResource ReverseVisibilityConverter}}"/>
  427. </Grid>
  428. </Grid>
  429. </TabItem>
  430. </TabControl>
  431. <Grid Grid.Row="2" Margin="11,0,11,0" VerticalAlignment="Top">
  432. <Button Height="32" Width="72" HorizontalAlignment="Left" Content="{Binding Converter={StaticResource PropertyPanelResourceConverter},ConverterParameter=Button_Clear}" Click="Clear_Click"/>
  433. <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
  434. <Button Width="81" Height="32" Content="{Binding Converter={StaticResource PropertyPanelResourceConverter}, ConverterParameter=Button_Cancel}" Click="Cancel_Click"/>
  435. <Button x:Name="SaveBtn" Width="136" Height="32" Content="{Binding Converter={StaticResource PropertyPanelResourceConverter}, ConverterParameter=Button_Save}" Margin="8,0,0,0" Click="Save_Click" Style="{StaticResource ButtonStyle}" IsEnabled="False"/>
  436. </StackPanel>
  437. </Grid>
  438. </Grid>
  439. </Window>