CPDFCreateStampDialog.xaml 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407
  1. <Window x:Class="Compdfkit_Tools.Annotation.PDFAnnotationPanel.PDFAnnotationUI.CPDFCreateStampDialog"
  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:local="clr-namespace:Compdfkit_Tools.Annotation.PDFAnnotationPanel.PDFAnnotationUI" xmlns:cpdfcommon="clr-namespace:Compdfkit_Tools.Common"
  7. mc:Ignorable="d"
  8. AllowsTransparency="True"
  9. WindowStyle="None"
  10. ShowInTaskbar="False"
  11. ResizeMode="NoResize"
  12. Loaded="Window_Loaded"
  13. Title="CreateStampDialog" Height="357" Width="626">
  14. <Window.Resources>
  15. <ResourceDictionary>
  16. <ResourceDictionary.MergedDictionaries>
  17. <ResourceDictionary Source="../../../Asset/Styles/ButtonStyle.xaml"></ResourceDictionary>
  18. </ResourceDictionary.MergedDictionaries>
  19. <cpdfcommon:ReverseVisibilityConverter x:Key="ReverseVisibilityConverter"/>
  20. <SolidColorBrush x:Key="TabItem.Selected.Background" Color="#FFFFFF"/>
  21. <SolidColorBrush x:Key="TabItem.Selected.Border" Color="#ACACAC"/>
  22. <Style x:Key="TabControlStyle1" TargetType="{x:Type TabControl}">
  23. <Setter Property="Padding" Value="2"/>
  24. <Setter Property="HorizontalContentAlignment" Value="Center"/>
  25. <Setter Property="VerticalContentAlignment" Value="Center"/>
  26. <Setter Property="Background" Value="{StaticResource TabItem.Selected.Background}"/>
  27. <Setter Property="BorderBrush" Value="{StaticResource TabItem.Selected.Border}"/>
  28. <Setter Property="BorderThickness" Value="0"/>
  29. <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
  30. <Setter Property="Template">
  31. <Setter.Value>
  32. <ControlTemplate TargetType="{x:Type TabControl}">
  33. <Grid x:Name="templateRoot" ClipToBounds="true" SnapsToDevicePixels="true" KeyboardNavigation.TabNavigation="Local">
  34. <Grid.ColumnDefinitions>
  35. <ColumnDefinition x:Name="ColumnDefinition0"/>
  36. <ColumnDefinition x:Name="ColumnDefinition1" Width="0"/>
  37. </Grid.ColumnDefinitions>
  38. <Grid.RowDefinitions>
  39. <RowDefinition x:Name="RowDefinition0" Height="Auto"/>
  40. <RowDefinition x:Name="RowDefinition1" Height="*"/>
  41. </Grid.RowDefinitions>
  42. <TabPanel x:Name="headerPanel" Background="Transparent" Grid.Column="0" IsItemsHost="true" Margin="2,2,2,0" Grid.Row="0" KeyboardNavigation.TabIndex="1" Panel.ZIndex="1"/>
  43. <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">
  44. <ContentPresenter x:Name="PART_SelectedContentHost" ContentSource="SelectedContent" Margin="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
  45. </Border>
  46. </Grid>
  47. <ControlTemplate.Triggers>
  48. <Trigger Property="TabStripPlacement" Value="Bottom">
  49. <Setter Property="Grid.Row" TargetName="headerPanel" Value="1"/>
  50. <Setter Property="Grid.Row" TargetName="contentPanel" Value="0"/>
  51. <Setter Property="Height" TargetName="RowDefinition0" Value="*"/>
  52. <Setter Property="Height" TargetName="RowDefinition1" Value="Auto"/>
  53. <Setter Property="Margin" TargetName="headerPanel" Value="2,0,2,2"/>
  54. </Trigger>
  55. <Trigger Property="TabStripPlacement" Value="Left">
  56. <Setter Property="Grid.Row" TargetName="headerPanel" Value="0"/>
  57. <Setter Property="Grid.Row" TargetName="contentPanel" Value="0"/>
  58. <Setter Property="Grid.Column" TargetName="headerPanel" Value="0"/>
  59. <Setter Property="Grid.Column" TargetName="contentPanel" Value="1"/>
  60. <Setter Property="Width" TargetName="ColumnDefinition0" Value="Auto"/>
  61. <Setter Property="Width" TargetName="ColumnDefinition1" Value="*"/>
  62. <Setter Property="Height" TargetName="RowDefinition0" Value="*"/>
  63. <Setter Property="Height" TargetName="RowDefinition1" Value="0"/>
  64. <Setter Property="Margin" TargetName="headerPanel" Value="2,2,0,2"/>
  65. </Trigger>
  66. <Trigger Property="TabStripPlacement" Value="Right">
  67. <Setter Property="Grid.Row" TargetName="headerPanel" Value="0"/>
  68. <Setter Property="Grid.Row" TargetName="contentPanel" Value="0"/>
  69. <Setter Property="Grid.Column" TargetName="headerPanel" Value="1"/>
  70. <Setter Property="Grid.Column" TargetName="contentPanel" Value="0"/>
  71. <Setter Property="Width" TargetName="ColumnDefinition0" Value="*"/>
  72. <Setter Property="Width" TargetName="ColumnDefinition1" Value="Auto"/>
  73. <Setter Property="Height" TargetName="RowDefinition0" Value="*"/>
  74. <Setter Property="Height" TargetName="RowDefinition1" Value="0"/>
  75. <Setter Property="Margin" TargetName="headerPanel" Value="0,2,2,2"/>
  76. </Trigger>
  77. <Trigger Property="IsEnabled" Value="false">
  78. <Setter Property="TextElement.Foreground" TargetName="templateRoot" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
  79. </Trigger>
  80. </ControlTemplate.Triggers>
  81. </ControlTemplate>
  82. </Setter.Value>
  83. </Setter>
  84. </Style>
  85. <Style x:Key="FocusVisual">
  86. <Setter Property="Control.Template">
  87. <Setter.Value>
  88. <ControlTemplate>
  89. <Rectangle Margin="2" StrokeDashArray="1 2" Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" SnapsToDevicePixels="true" StrokeThickness="1"/>
  90. </ControlTemplate>
  91. </Setter.Value>
  92. </Setter>
  93. </Style>
  94. <LinearGradientBrush x:Key="TabItem.Static.Background" EndPoint="0,1" StartPoint="0,0">
  95. <GradientStop Color="#F0F0F0" Offset="0.0"/>
  96. <GradientStop Color="#E5E5E5" Offset="1.0"/>
  97. </LinearGradientBrush>
  98. <SolidColorBrush x:Key="TabItem.Static.Border" Color="#ACACAC"/>
  99. <LinearGradientBrush x:Key="TabItem.MouseOver.Background" EndPoint="0,1" StartPoint="0,0">
  100. <GradientStop Color="#ECF4FC" Offset="0.0"/>
  101. <GradientStop Color="#DCECFC" Offset="1.0"/>
  102. </LinearGradientBrush>
  103. <SolidColorBrush x:Key="TabItem.MouseOver.Border" Color="#7EB4EA"/>
  104. <SolidColorBrush x:Key="TabItem.Selected.Background1" Color="#FFFFFF"/>
  105. <SolidColorBrush x:Key="TabItem.Selected.Border1" Color="#1460F3"/>
  106. <SolidColorBrush x:Key="TabItem.Disabled.Background" Color="#F0F0F0"/>
  107. <SolidColorBrush x:Key="TabItem.Disabled.Border" Color="#FFFFFF"/>
  108. <Style x:Key="TabItemStyle1" TargetType="{x:Type TabItem}">
  109. <Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual}"/>
  110. <Setter Property="Foreground" Value="Black"/>
  111. <Setter Property="Background" Value="{StaticResource TabItem.Static.Background}"/>
  112. <Setter Property="BorderBrush" Value="{StaticResource TabItem.Static.Border}"/>
  113. <Setter Property="Margin" Value="0"/>
  114. <Setter Property="Padding" Value="6,2,6,2"/>
  115. <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
  116. <Setter Property="VerticalContentAlignment" Value="Stretch"/>
  117. <Setter Property="Template">
  118. <Setter.Value>
  119. <ControlTemplate TargetType="{x:Type TabItem}">
  120. <Grid x:Name="templateRoot" SnapsToDevicePixels="true">
  121. <Border x:Name="mainBorder" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="0,0,0,1" Margin="0">
  122. <Border x:Name="innerBorder" Background="{StaticResource TabItem.Selected.Background1}" BorderBrush="{StaticResource TabItem.Selected.Border1}" BorderThickness="0,0,0,1" Margin="-1" Opacity="0"/>
  123. </Border>
  124. <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}}}"/>
  125. </Grid>
  126. <ControlTemplate.Triggers>
  127. <MultiDataTrigger>
  128. <MultiDataTrigger.Conditions>
  129. <Condition Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}" Value="true"/>
  130. <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Left"/>
  131. </MultiDataTrigger.Conditions>
  132. <Setter Property="Background" TargetName="mainBorder" Value="{StaticResource TabItem.MouseOver.Background}"/>
  133. <Setter Property="BorderBrush" TargetName="mainBorder" Value="{StaticResource TabItem.MouseOver.Border}"/>
  134. <Setter Property="BorderThickness" TargetName="innerBorder" Value="0,0,0,1"/>
  135. <Setter Property="BorderThickness" TargetName="mainBorder" Value="0,0,0,1"/>
  136. </MultiDataTrigger>
  137. <MultiDataTrigger>
  138. <MultiDataTrigger.Conditions>
  139. <Condition Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}" Value="true"/>
  140. <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Bottom"/>
  141. </MultiDataTrigger.Conditions>
  142. <Setter Property="Background" TargetName="mainBorder" Value="{StaticResource TabItem.MouseOver.Background}"/>
  143. <Setter Property="BorderBrush" TargetName="mainBorder" Value="{StaticResource TabItem.MouseOver.Border}"/>
  144. <Setter Property="BorderThickness" TargetName="innerBorder" Value="0,0,0,1"/>
  145. <Setter Property="BorderThickness" TargetName="mainBorder" Value="0,0,0,1"/>
  146. </MultiDataTrigger>
  147. <MultiDataTrigger>
  148. <MultiDataTrigger.Conditions>
  149. <Condition Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}" Value="true"/>
  150. <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Right"/>
  151. </MultiDataTrigger.Conditions>
  152. <Setter Property="Background" TargetName="mainBorder" Value="{StaticResource TabItem.MouseOver.Background}"/>
  153. <Setter Property="BorderBrush" TargetName="mainBorder" Value="{StaticResource TabItem.MouseOver.Border}"/>
  154. <Setter Property="BorderThickness" TargetName="innerBorder" Value="0,0,0,1"/>
  155. <Setter Property="BorderThickness" TargetName="mainBorder" Value="0,0,0,1"/>
  156. </MultiDataTrigger>
  157. <MultiDataTrigger>
  158. <MultiDataTrigger.Conditions>
  159. <Condition Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}" Value="true"/>
  160. <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Top"/>
  161. </MultiDataTrigger.Conditions>
  162. <Setter Property="Background" TargetName="mainBorder" Value="{StaticResource TabItem.MouseOver.Background}"/>
  163. <Setter Property="BorderBrush" TargetName="mainBorder" Value="{StaticResource TabItem.MouseOver.Border}"/>
  164. <Setter Property="BorderThickness" TargetName="innerBorder" Value="0,0,0,1"/>
  165. <Setter Property="BorderThickness" TargetName="mainBorder" Value="0,0,0,1"/>
  166. </MultiDataTrigger>
  167. <MultiDataTrigger>
  168. <MultiDataTrigger.Conditions>
  169. <Condition Binding="{Binding IsEnabled, RelativeSource={RelativeSource Self}}" Value="false"/>
  170. <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Left"/>
  171. </MultiDataTrigger.Conditions>
  172. <Setter Property="Opacity" TargetName="contentPresenter" Value="0.56"/>
  173. <Setter Property="Background" TargetName="mainBorder" Value="{StaticResource TabItem.Disabled.Background}"/>
  174. <Setter Property="BorderBrush" TargetName="mainBorder" Value="{StaticResource TabItem.Disabled.Border}"/>
  175. <Setter Property="BorderThickness" TargetName="innerBorder" Value="0,0,0,0"/>
  176. <Setter Property="BorderThickness" TargetName="mainBorder" Value="0,0,0,0"/>
  177. </MultiDataTrigger>
  178. <MultiDataTrigger>
  179. <MultiDataTrigger.Conditions>
  180. <Condition Binding="{Binding IsEnabled, RelativeSource={RelativeSource Self}}" Value="false"/>
  181. <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Bottom"/>
  182. </MultiDataTrigger.Conditions>
  183. <Setter Property="Opacity" TargetName="contentPresenter" Value="0.56"/>
  184. <Setter Property="Background" TargetName="mainBorder" Value="{StaticResource TabItem.Disabled.Background}"/>
  185. <Setter Property="BorderBrush" TargetName="mainBorder" Value="{StaticResource TabItem.Disabled.Border}"/>
  186. <Setter Property="BorderThickness" TargetName="innerBorder" Value="0,0,0,0"/>
  187. <Setter Property="BorderThickness" TargetName="mainBorder" Value="0,0,0,0"/>
  188. </MultiDataTrigger>
  189. <MultiDataTrigger>
  190. <MultiDataTrigger.Conditions>
  191. <Condition Binding="{Binding IsEnabled, RelativeSource={RelativeSource Self}}" Value="false"/>
  192. <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Right"/>
  193. </MultiDataTrigger.Conditions>
  194. <Setter Property="Opacity" TargetName="contentPresenter" Value="0.56"/>
  195. <Setter Property="Background" TargetName="mainBorder" Value="{StaticResource TabItem.Disabled.Background}"/>
  196. <Setter Property="BorderBrush" TargetName="mainBorder" Value="{StaticResource TabItem.Disabled.Border}"/>
  197. <Setter Property="BorderThickness" TargetName="innerBorder" Value="0,0,0,0"/>
  198. <Setter Property="BorderThickness" TargetName="mainBorder" Value="0,0,0,0"/>
  199. </MultiDataTrigger>
  200. <MultiDataTrigger>
  201. <MultiDataTrigger.Conditions>
  202. <Condition Binding="{Binding IsEnabled, RelativeSource={RelativeSource Self}}" Value="false"/>
  203. <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Top"/>
  204. </MultiDataTrigger.Conditions>
  205. <Setter Property="Opacity" TargetName="contentPresenter" Value="0.56"/>
  206. <Setter Property="Background" TargetName="mainBorder" Value="{StaticResource TabItem.Disabled.Background}"/>
  207. <Setter Property="BorderBrush" TargetName="mainBorder" Value="{StaticResource TabItem.Disabled.Border}"/>
  208. <Setter Property="BorderThickness" TargetName="innerBorder" Value="0,0,0,0"/>
  209. <Setter Property="BorderThickness" TargetName="mainBorder" Value="0,0,0,0"/>
  210. </MultiDataTrigger>
  211. <MultiDataTrigger>
  212. <MultiDataTrigger.Conditions>
  213. <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="false"/>
  214. <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Left"/>
  215. </MultiDataTrigger.Conditions>
  216. <Setter Property="Opacity" TargetName="innerBorder" Value="1"/>
  217. <Setter Property="BorderThickness" TargetName="innerBorder" Value="0,0,0,0"/>
  218. <Setter Property="BorderThickness" TargetName="mainBorder" Value="0,0,0,0"/>
  219. </MultiDataTrigger>
  220. <MultiDataTrigger>
  221. <MultiDataTrigger.Conditions>
  222. <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="true"/>
  223. <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Left"/>
  224. </MultiDataTrigger.Conditions>
  225. <Setter Property="Panel.ZIndex" Value="1"/>
  226. <Setter Property="Margin" Value="-2,-2,0,-2"/>
  227. <Setter Property="Opacity" TargetName="innerBorder" Value="1"/>
  228. <Setter Property="BorderThickness" TargetName="innerBorder" Value="0,0,0,1"/>
  229. <Setter Property="BorderThickness" TargetName="mainBorder" Value="0,0,0,1"/>
  230. </MultiDataTrigger>
  231. <MultiDataTrigger>
  232. <MultiDataTrigger.Conditions>
  233. <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="false"/>
  234. <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Bottom"/>
  235. </MultiDataTrigger.Conditions>
  236. <Setter Property="Opacity" TargetName="innerBorder" Value="1"/>
  237. <Setter Property="BorderThickness" TargetName="innerBorder" Value="0,0,0,0"/>
  238. <Setter Property="BorderThickness" TargetName="mainBorder" Value="0,0,0,0"/>
  239. </MultiDataTrigger>
  240. <MultiDataTrigger>
  241. <MultiDataTrigger.Conditions>
  242. <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="true"/>
  243. <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Bottom"/>
  244. </MultiDataTrigger.Conditions>
  245. <Setter Property="Panel.ZIndex" Value="1"/>
  246. <Setter Property="Margin" Value="-2,0,-2,-2"/>
  247. <Setter Property="Opacity" TargetName="innerBorder" Value="1"/>
  248. <Setter Property="BorderThickness" TargetName="innerBorder" Value="0,0,0,1"/>
  249. <Setter Property="BorderThickness" TargetName="mainBorder" Value="0,0,0,1"/>
  250. </MultiDataTrigger>
  251. <MultiDataTrigger>
  252. <MultiDataTrigger.Conditions>
  253. <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="false"/>
  254. <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Right"/>
  255. </MultiDataTrigger.Conditions>
  256. <Setter Property="Opacity" TargetName="innerBorder" Value="1"/>
  257. <Setter Property="BorderThickness" TargetName="innerBorder" Value="0,0,0,0"/>
  258. <Setter Property="BorderThickness" TargetName="mainBorder" Value="0,0,0,0"/>
  259. </MultiDataTrigger>
  260. <MultiDataTrigger>
  261. <MultiDataTrigger.Conditions>
  262. <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="true"/>
  263. <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Right"/>
  264. </MultiDataTrigger.Conditions>
  265. <Setter Property="Panel.ZIndex" Value="1"/>
  266. <Setter Property="Margin" Value="0,-2,-2,-2"/>
  267. <Setter Property="Opacity" TargetName="innerBorder" Value="1"/>
  268. <Setter Property="BorderThickness" TargetName="innerBorder" Value="0,0,0,1"/>
  269. <Setter Property="BorderThickness" TargetName="mainBorder" Value="0,0,0,1"/>
  270. </MultiDataTrigger>
  271. <MultiDataTrigger>
  272. <MultiDataTrigger.Conditions>
  273. <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="false"/>
  274. <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Top"/>
  275. </MultiDataTrigger.Conditions>
  276. <Setter Property="Opacity" TargetName="innerBorder" Value="1"/>
  277. <Setter Property="BorderThickness" TargetName="innerBorder" Value="0,0,0,0"/>
  278. <Setter Property="BorderThickness" TargetName="mainBorder" Value="0,0,0,0"/>
  279. </MultiDataTrigger>
  280. <MultiDataTrigger>
  281. <MultiDataTrigger.Conditions>
  282. <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="true"/>
  283. <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Top"/>
  284. </MultiDataTrigger.Conditions>
  285. <Setter Property="Panel.ZIndex" Value="1"/>
  286. <Setter Property="Margin" Value="-2,-2,-2,0"/>
  287. <Setter Property="Opacity" TargetName="innerBorder" Value="1"/>
  288. <Setter Property="BorderThickness" TargetName="innerBorder" Value="0,0,0,1"/>
  289. <Setter Property="BorderThickness" TargetName="mainBorder" Value="0,0,0,1"/>
  290. </MultiDataTrigger>
  291. </ControlTemplate.Triggers>
  292. </ControlTemplate>
  293. </Setter.Value>
  294. </Setter>
  295. </Style>
  296. <Style x:Key="LinkButton" TargetType="Button">
  297. <Setter Property="Width" Value="Auto"/>
  298. <Setter Property="Template">
  299. <Setter.Value>
  300. <ControlTemplate TargetType="Button">
  301. <ContentPresenter Content="{TemplateBinding Content}"
  302. ContentTemplate="{TemplateBinding ContentTemplate}"
  303. VerticalAlignment="Center"
  304. >
  305. <ContentPresenter.Resources>
  306. <Style TargetType="{x:Type TextBlock}">
  307. <Setter Property="TextDecorations" Value="Underline" />
  308. </Style>
  309. </ContentPresenter.Resources>
  310. </ContentPresenter>
  311. </ControlTemplate>
  312. </Setter.Value>
  313. </Setter>
  314. <Setter Property="Foreground" Value="Blue" />
  315. <Setter Property="Cursor" Value="Hand" />
  316. <Style.Triggers>
  317. <Trigger Property="IsMouseOver" Value="true">
  318. <Setter Property="Foreground" Value="Red" />
  319. </Trigger>
  320. </Style.Triggers>
  321. </Style>
  322. </ResourceDictionary>
  323. </Window.Resources>
  324. <Grid>
  325. <Grid.RowDefinitions>
  326. <RowDefinition Height="26"/>
  327. <RowDefinition Height="*"/>
  328. <RowDefinition Height="41"/>
  329. <RowDefinition Height="11"/>
  330. </Grid.RowDefinitions>
  331. <TabControl Margin="23,0,23,0" x:Name="CreateHeader" Style="{DynamicResource TabControlStyle1}" Grid.Row="1" SelectionChanged="CreateHeader_SelectionChanged">
  332. <TabItem Header="Text Stamp" Style="{DynamicResource TabItemStyle1}">
  333. <Grid >
  334. <Grid.RowDefinitions>
  335. <RowDefinition Height="11" />
  336. <RowDefinition Height="240" />
  337. <RowDefinition Height="14" />
  338. <RowDefinition Height="*" />
  339. </Grid.RowDefinitions>
  340. <Grid.ColumnDefinitions>
  341. <ColumnDefinition Width="196"/>
  342. <ColumnDefinition Width="20"/>
  343. <ColumnDefinition Width="*"/>
  344. </Grid.ColumnDefinitions>
  345. <Grid Grid.Row="1" Grid.Column="2">
  346. <Grid.RowDefinitions>
  347. <RowDefinition Height="20"/>
  348. <RowDefinition Height="*"/>
  349. <RowDefinition Height="32"/>
  350. <RowDefinition Height="14"/>
  351. <RowDefinition Height="20"/>
  352. <RowDefinition Height="12"/>
  353. <RowDefinition Height="20"/>
  354. </Grid.RowDefinitions>
  355. <TextBlock Text="Preview" FontSize="14" FontFamily="Segoe UI" FontWeight="Bold"/>
  356. <Image Grid.Row="1" x:Name="TextImage" HorizontalAlignment="Center" VerticalAlignment="Center"/>
  357. <StackPanel Grid.Row="2" Orientation="Horizontal" Height="32">
  358. <TextBlock Margin="18,0,23,0" Text="Text" VerticalAlignment="Center"/>
  359. <TextBox x:Name="StampText" Width="233" Text="Stamp Text" VerticalContentAlignment="Center" TextChanged="TextBox_TextChanged"/>
  360. </StackPanel>
  361. <CheckBox Grid.Row="4" Name="Date" Content="Date (YYYY-MM-DD)" Checked="Date_Checked" Unchecked="Date_Unchecked"/>
  362. <CheckBox Grid.Row="6" Name="Time" Content="Time (HH:MM:SS)" Checked="Time_Checked" Unchecked="Time_Unchecked"/>
  363. </Grid>
  364. <StackPanel Grid.Row="1">
  365. <TextBlock Text="Stamp Template:" VerticalAlignment="Center" FontSize="14" FontFamily="Segoe UI" FontWeight="Bold"/>
  366. <ListBox x:Name="ShapeBox" SelectedIndex="0" VerticalContentAlignment="Center" SelectionChanged="ShapeBox_SelectionChanged"/>
  367. </StackPanel>
  368. </Grid>
  369. </TabItem>
  370. <TabItem Header="Image Stamp" Style="{DynamicResource TabItemStyle1}">
  371. <Grid
  372. AllowDrop="True"
  373. PreviewDrop="Grid_Drop"
  374. >
  375. <Grid.RowDefinitions>
  376. <RowDefinition Height="11" />
  377. <RowDefinition Height="240" />
  378. <RowDefinition Height="14" />
  379. </Grid.RowDefinitions>
  380. <Grid Background="#F2F3F5" Grid.Row="1">
  381. <Grid.RowDefinitions>
  382. <RowDefinition Height="182"/>
  383. <RowDefinition Height="20"/>
  384. <RowDefinition Height="38"/>
  385. </Grid.RowDefinitions>
  386. <StackPanel x:Name="AddImagebackground" VerticalAlignment="Bottom">
  387. <Image Height="112" Width="112" Source="../../../Asset/Resource/Annotation/Signature/Dropimage.png"/>
  388. <TextBlock Text="Drop image here" HorizontalAlignment="Center"/>
  389. <TextBlock Text="or" HorizontalAlignment="Center"/>
  390. <Button Style="{DynamicResource LinkButton}" HorizontalAlignment="Center" Content="Select a File" Click="OpenImage_Click"/>
  391. </StackPanel>
  392. <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}}"/>
  393. </Grid>
  394. </Grid>
  395. </TabItem>
  396. </TabControl>
  397. <Grid Grid.Row="2" Margin="11,0,11,0" VerticalAlignment="Top">
  398. <Button Content="Clear" Click="Clear_Click" Height="32" Width="72" HorizontalAlignment="Left"/>
  399. <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" >
  400. <Button Content="Cancel" Click="Cancel_Click" Width="81" Height="32"/>
  401. <Button Content="Save" Click="Save_Click" x:Name="SaveBtn" Width="136" Height="32" Margin="8,0,0,0" IsEnabled="True" Style="{StaticResource ButtonStyle}"/>
  402. </StackPanel>
  403. </Grid>
  404. </Grid>
  405. </Window>