CPDFCreateStampDialog.xaml 34 KB

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