CPDFLinkUI.xaml 38 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467
  1. <UserControl x:Class="Compdfkit_Tools.Annotation.PDFAnnotationUI.CPDFLinkUI"
  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:local="clr-namespace:Compdfkit_Tools.Annotation.PDFAnnotationUI"
  7. xmlns:cpdfcommon="clr-namespace:Compdfkit_Tools.Common"
  8. mc:Ignorable="d"
  9. Loaded="UserControl_Loaded"
  10. Unloaded="UserControl_Unloaded"
  11. d:DesignHeight="450" d:DesignWidth="800">
  12. <UserControl.Resources>
  13. <cpdfcommon:TextLengthToVisibilityConverter x:Key="TextLengthToVisibilityConverter"></cpdfcommon:TextLengthToVisibilityConverter>
  14. <cpdfcommon:BoolToCollapsedConverter x:Key="BoolToCollapsedConverter"></cpdfcommon:BoolToCollapsedConverter>
  15. <SolidColorBrush x:Key="TabItem.Selected.Background" Color="#FFFFFF"/>
  16. <SolidColorBrush x:Key="TabItem.Selected.Border" Color="#ACACAC"/>
  17. <Style x:Key="TabControlStyle1" TargetType="{x:Type TabControl}">
  18. <Setter Property="Padding" Value="2"/>
  19. <Setter Property="HorizontalContentAlignment" Value="Center"/>
  20. <Setter Property="VerticalContentAlignment" Value="Center"/>
  21. <Setter Property="Background" Value="{StaticResource TabItem.Selected.Background}"/>
  22. <Setter Property="BorderBrush" Value="{StaticResource TabItem.Selected.Border}"/>
  23. <Setter Property="BorderThickness" Value="0"/>
  24. <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
  25. <Setter Property="Template">
  26. <Setter.Value>
  27. <ControlTemplate TargetType="{x:Type TabControl}">
  28. <Grid x:Name="templateRoot" ClipToBounds="true" SnapsToDevicePixels="true" KeyboardNavigation.TabNavigation="Local">
  29. <Grid.ColumnDefinitions>
  30. <ColumnDefinition x:Name="ColumnDefinition0"/>
  31. <ColumnDefinition x:Name="ColumnDefinition1" Width="0"/>
  32. </Grid.ColumnDefinitions>
  33. <Grid.RowDefinitions>
  34. <RowDefinition x:Name="RowDefinition0" Height="Auto"/>
  35. <RowDefinition x:Name="RowDefinition1" Height="*"/>
  36. </Grid.RowDefinitions>
  37. <UniformGrid x:Name="headerPanel" Background="Transparent" Grid.Column="0" IsItemsHost="true" Margin="2,2,2,0" Grid.Row="0" KeyboardNavigation.TabIndex="1" Panel.ZIndex="1" Rows="1"/>
  38. <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">
  39. <ContentPresenter x:Name="PART_SelectedContentHost" ContentSource="SelectedContent" Margin="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
  40. </Border>
  41. </Grid>
  42. <ControlTemplate.Triggers>
  43. <Trigger Property="TabStripPlacement" Value="Bottom">
  44. <Setter Property="Grid.Row" TargetName="headerPanel" Value="1"/>
  45. <Setter Property="Grid.Row" TargetName="contentPanel" Value="0"/>
  46. <Setter Property="Height" TargetName="RowDefinition0" Value="*"/>
  47. <Setter Property="Height" TargetName="RowDefinition1" Value="Auto"/>
  48. <Setter Property="Margin" TargetName="headerPanel" Value="2,0,2,2"/>
  49. </Trigger>
  50. <Trigger Property="TabStripPlacement" Value="Left">
  51. <Setter Property="Grid.Row" TargetName="headerPanel" Value="0"/>
  52. <Setter Property="Grid.Row" TargetName="contentPanel" Value="0"/>
  53. <Setter Property="Grid.Column" TargetName="headerPanel" Value="0"/>
  54. <Setter Property="Grid.Column" TargetName="contentPanel" Value="1"/>
  55. <Setter Property="Width" TargetName="ColumnDefinition0" Value="Auto"/>
  56. <Setter Property="Width" TargetName="ColumnDefinition1" Value="*"/>
  57. <Setter Property="Height" TargetName="RowDefinition0" Value="*"/>
  58. <Setter Property="Height" TargetName="RowDefinition1" Value="0"/>
  59. <Setter Property="Margin" TargetName="headerPanel" Value="2,2,0,2"/>
  60. </Trigger>
  61. <Trigger Property="TabStripPlacement" Value="Right">
  62. <Setter Property="Grid.Row" TargetName="headerPanel" Value="0"/>
  63. <Setter Property="Grid.Row" TargetName="contentPanel" Value="0"/>
  64. <Setter Property="Grid.Column" TargetName="headerPanel" Value="1"/>
  65. <Setter Property="Grid.Column" TargetName="contentPanel" Value="0"/>
  66. <Setter Property="Width" TargetName="ColumnDefinition0" Value="*"/>
  67. <Setter Property="Width" TargetName="ColumnDefinition1" Value="Auto"/>
  68. <Setter Property="Height" TargetName="RowDefinition0" Value="*"/>
  69. <Setter Property="Height" TargetName="RowDefinition1" Value="0"/>
  70. <Setter Property="Margin" TargetName="headerPanel" Value="0,2,2,2"/>
  71. </Trigger>
  72. <Trigger Property="IsEnabled" Value="false">
  73. <Setter Property="TextElement.Foreground" TargetName="templateRoot" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
  74. </Trigger>
  75. </ControlTemplate.Triggers>
  76. </ControlTemplate>
  77. </Setter.Value>
  78. </Setter>
  79. </Style>
  80. <Style x:Key="FocusVisual">
  81. <Setter Property="Control.Template">
  82. <Setter.Value>
  83. <ControlTemplate>
  84. <Rectangle Margin="2" StrokeDashArray="1 2" Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" SnapsToDevicePixels="true" StrokeThickness="1"/>
  85. </ControlTemplate>
  86. </Setter.Value>
  87. </Setter>
  88. </Style>
  89. <LinearGradientBrush x:Key="TabItem.Static.Background" EndPoint="0,1" StartPoint="0,0">
  90. <GradientStop Color="#F0F0F0" Offset="0.0"/>
  91. <GradientStop Color="#E5E5E5" Offset="1.0"/>
  92. </LinearGradientBrush>
  93. <SolidColorBrush x:Key="TabItem.Static.Border" Color="#ACACAC"/>
  94. <LinearGradientBrush x:Key="TabItem.MouseOver.Background" EndPoint="0,1" StartPoint="0,0">
  95. <GradientStop Color="#ECF4FC" Offset="0.0"/>
  96. <GradientStop Color="#DCECFC" Offset="1.0"/>
  97. </LinearGradientBrush>
  98. <SolidColorBrush x:Key="TabItem.MouseOver.Border" Color="#7EB4EA"/>
  99. <SolidColorBrush x:Key="TabItem.Selected.Background1" Color="#1460F3"/>
  100. <SolidColorBrush x:Key="TabItem.Selected.Border1" Color="#ACACAC"/>
  101. <SolidColorBrush x:Key="TabItem.Disabled.Background" Color="#1460F3"/>
  102. <SolidColorBrush x:Key="TabItem.Disabled.Border" Color="#D9D9D9"/>
  103. <Style x:Key="TabItemStyle1" TargetType="{x:Type TabItem}">
  104. <Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual}"/>
  105. <Setter Property="Foreground" Value="Black"/>
  106. <Setter Property="Background" Value="{StaticResource TabItem.Static.Background}"/>
  107. <Setter Property="BorderBrush" Value="{StaticResource TabItem.Static.Border}"/>
  108. <Setter Property="Margin" Value="0"/>
  109. <Setter Property="Padding" Value="6,2,6,2"/>
  110. <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
  111. <Setter Property="VerticalContentAlignment" Value="Stretch"/>
  112. <Setter Property="Template">
  113. <Setter.Value>
  114. <ControlTemplate TargetType="{x:Type TabItem}">
  115. <Grid x:Name="templateRoot" SnapsToDevicePixels="true">
  116. <Border x:Name="mainBorder" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1,1,1,0" Margin="0">
  117. <Border x:Name="innerBorder" Background="{StaticResource TabItem.Selected.Background1}" BorderBrush="{StaticResource TabItem.Selected.Border1}" BorderThickness="1,1,1,0" Margin="-1" Opacity="0"/>
  118. </Border>
  119. <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}}}"/>
  120. </Grid>
  121. <ControlTemplate.Triggers>
  122. <MultiDataTrigger>
  123. <MultiDataTrigger.Conditions>
  124. <Condition Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}" Value="true"/>
  125. <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Left"/>
  126. </MultiDataTrigger.Conditions>
  127. <Setter Property="Background" TargetName="mainBorder" Value="{StaticResource TabItem.MouseOver.Background}"/>
  128. <Setter Property="BorderBrush" TargetName="mainBorder" Value="{StaticResource TabItem.MouseOver.Border}"/>
  129. <Setter Property="BorderThickness" TargetName="innerBorder" Value="1,1,0,1"/>
  130. <Setter Property="BorderThickness" TargetName="mainBorder" Value="1,1,0,1"/>
  131. </MultiDataTrigger>
  132. <MultiDataTrigger>
  133. <MultiDataTrigger.Conditions>
  134. <Condition Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}" Value="true"/>
  135. <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Bottom"/>
  136. </MultiDataTrigger.Conditions>
  137. <Setter Property="Background" TargetName="mainBorder" Value="{StaticResource TabItem.MouseOver.Background}"/>
  138. <Setter Property="BorderBrush" TargetName="mainBorder" Value="{StaticResource TabItem.MouseOver.Border}"/>
  139. <Setter Property="BorderThickness" TargetName="innerBorder" Value="1,0,1,1"/>
  140. <Setter Property="BorderThickness" TargetName="mainBorder" Value="1,0,1,1"/>
  141. </MultiDataTrigger>
  142. <MultiDataTrigger>
  143. <MultiDataTrigger.Conditions>
  144. <Condition Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}" Value="true"/>
  145. <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Right"/>
  146. </MultiDataTrigger.Conditions>
  147. <Setter Property="Background" TargetName="mainBorder" Value="{StaticResource TabItem.MouseOver.Background}"/>
  148. <Setter Property="BorderBrush" TargetName="mainBorder" Value="{StaticResource TabItem.MouseOver.Border}"/>
  149. <Setter Property="BorderThickness" TargetName="innerBorder" Value="0,1,1,1"/>
  150. <Setter Property="BorderThickness" TargetName="mainBorder" Value="0,1,1,1"/>
  151. </MultiDataTrigger>
  152. <MultiDataTrigger>
  153. <MultiDataTrigger.Conditions>
  154. <Condition Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}" Value="true"/>
  155. <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Top"/>
  156. </MultiDataTrigger.Conditions>
  157. <Setter Property="Background" TargetName="mainBorder" Value="{StaticResource TabItem.MouseOver.Background}"/>
  158. <Setter Property="BorderBrush" TargetName="mainBorder" Value="{StaticResource TabItem.MouseOver.Border}"/>
  159. <Setter Property="BorderThickness" TargetName="innerBorder" Value="1,1,1,0"/>
  160. <Setter Property="BorderThickness" TargetName="mainBorder" Value="1,1,1,0"/>
  161. </MultiDataTrigger>
  162. <MultiDataTrigger>
  163. <MultiDataTrigger.Conditions>
  164. <Condition Binding="{Binding IsEnabled, RelativeSource={RelativeSource Self}}" Value="false"/>
  165. <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Left"/>
  166. </MultiDataTrigger.Conditions>
  167. <Setter Property="Opacity" TargetName="contentPresenter" Value="0.56"/>
  168. <Setter Property="Background" TargetName="mainBorder" Value="{StaticResource TabItem.Disabled.Background}"/>
  169. <Setter Property="BorderBrush" TargetName="mainBorder" Value="{StaticResource TabItem.Disabled.Border}"/>
  170. <Setter Property="BorderThickness" TargetName="innerBorder" Value="1,1,0,1"/>
  171. <Setter Property="BorderThickness" TargetName="mainBorder" Value="1,1,0,1"/>
  172. </MultiDataTrigger>
  173. <MultiDataTrigger>
  174. <MultiDataTrigger.Conditions>
  175. <Condition Binding="{Binding IsEnabled, RelativeSource={RelativeSource Self}}" Value="false"/>
  176. <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Bottom"/>
  177. </MultiDataTrigger.Conditions>
  178. <Setter Property="Opacity" TargetName="contentPresenter" Value="0.56"/>
  179. <Setter Property="Background" TargetName="mainBorder" Value="{StaticResource TabItem.Disabled.Background}"/>
  180. <Setter Property="BorderBrush" TargetName="mainBorder" Value="{StaticResource TabItem.Disabled.Border}"/>
  181. <Setter Property="BorderThickness" TargetName="innerBorder" Value="1,0,1,1"/>
  182. <Setter Property="BorderThickness" TargetName="mainBorder" Value="1,0,1,1"/>
  183. </MultiDataTrigger>
  184. <MultiDataTrigger>
  185. <MultiDataTrigger.Conditions>
  186. <Condition Binding="{Binding IsEnabled, RelativeSource={RelativeSource Self}}" Value="false"/>
  187. <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Right"/>
  188. </MultiDataTrigger.Conditions>
  189. <Setter Property="Opacity" TargetName="contentPresenter" Value="0.56"/>
  190. <Setter Property="Background" TargetName="mainBorder" Value="{StaticResource TabItem.Disabled.Background}"/>
  191. <Setter Property="BorderBrush" TargetName="mainBorder" Value="{StaticResource TabItem.Disabled.Border}"/>
  192. <Setter Property="BorderThickness" TargetName="innerBorder" Value="0,1,1,1"/>
  193. <Setter Property="BorderThickness" TargetName="mainBorder" Value="0,1,1,1"/>
  194. </MultiDataTrigger>
  195. <MultiDataTrigger>
  196. <MultiDataTrigger.Conditions>
  197. <Condition Binding="{Binding IsEnabled, RelativeSource={RelativeSource Self}}" Value="false"/>
  198. <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Top"/>
  199. </MultiDataTrigger.Conditions>
  200. <Setter Property="Opacity" TargetName="contentPresenter" Value="0.56"/>
  201. <Setter Property="Background" TargetName="mainBorder" Value="{StaticResource TabItem.Disabled.Background}"/>
  202. <Setter Property="BorderBrush" TargetName="mainBorder" Value="{StaticResource TabItem.Disabled.Border}"/>
  203. <Setter Property="BorderThickness" TargetName="innerBorder" Value="1,1,1,0"/>
  204. <Setter Property="BorderThickness" TargetName="mainBorder" Value="1,1,1,0"/>
  205. </MultiDataTrigger>
  206. <MultiDataTrigger>
  207. <MultiDataTrigger.Conditions>
  208. <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="false"/>
  209. <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Left"/>
  210. </MultiDataTrigger.Conditions>
  211. <Setter Property="BorderThickness" TargetName="innerBorder" Value="1,1,0,1"/>
  212. <Setter Property="BorderThickness" TargetName="mainBorder" Value="1,1,0,1"/>
  213. </MultiDataTrigger>
  214. <MultiDataTrigger>
  215. <MultiDataTrigger.Conditions>
  216. <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="true"/>
  217. <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Left"/>
  218. </MultiDataTrigger.Conditions>
  219. <Setter Property="Panel.ZIndex" Value="1"/>
  220. <Setter Property="Margin" Value="-2,-2,0,-2"/>
  221. <Setter Property="Opacity" TargetName="innerBorder" Value="1"/>
  222. <Setter Property="BorderThickness" TargetName="innerBorder" Value="1,1,0,1"/>
  223. <Setter Property="BorderThickness" TargetName="mainBorder" Value="1,1,0,1"/>
  224. </MultiDataTrigger>
  225. <MultiDataTrigger>
  226. <MultiDataTrigger.Conditions>
  227. <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="false"/>
  228. <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Bottom"/>
  229. </MultiDataTrigger.Conditions>
  230. <Setter Property="BorderThickness" TargetName="innerBorder" Value="1,0,1,1"/>
  231. <Setter Property="BorderThickness" TargetName="mainBorder" Value="1,0,1,1"/>
  232. </MultiDataTrigger>
  233. <MultiDataTrigger>
  234. <MultiDataTrigger.Conditions>
  235. <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="true"/>
  236. <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Bottom"/>
  237. </MultiDataTrigger.Conditions>
  238. <Setter Property="Panel.ZIndex" Value="1"/>
  239. <Setter Property="Margin" Value="-2,0,-2,-2"/>
  240. <Setter Property="Opacity" TargetName="innerBorder" Value="1"/>
  241. <Setter Property="BorderThickness" TargetName="innerBorder" Value="1,0,1,1"/>
  242. <Setter Property="BorderThickness" TargetName="mainBorder" Value="1,0,1,1"/>
  243. </MultiDataTrigger>
  244. <MultiDataTrigger>
  245. <MultiDataTrigger.Conditions>
  246. <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="false"/>
  247. <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Right"/>
  248. </MultiDataTrigger.Conditions>
  249. <Setter Property="BorderThickness" TargetName="innerBorder" Value="0,1,1,1"/>
  250. <Setter Property="BorderThickness" TargetName="mainBorder" Value="0,1,1,1"/>
  251. </MultiDataTrigger>
  252. <MultiDataTrigger>
  253. <MultiDataTrigger.Conditions>
  254. <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="true"/>
  255. <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Right"/>
  256. </MultiDataTrigger.Conditions>
  257. <Setter Property="Panel.ZIndex" Value="1"/>
  258. <Setter Property="Margin" Value="0,-2,-2,-2"/>
  259. <Setter Property="Opacity" TargetName="innerBorder" Value="1"/>
  260. <Setter Property="BorderThickness" TargetName="innerBorder" Value="0,1,1,1"/>
  261. <Setter Property="BorderThickness" TargetName="mainBorder" Value="0,1,1,1"/>
  262. </MultiDataTrigger>
  263. <MultiDataTrigger>
  264. <MultiDataTrigger.Conditions>
  265. <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="false"/>
  266. <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Top"/>
  267. </MultiDataTrigger.Conditions>
  268. <Setter Property="BorderThickness" TargetName="innerBorder" Value="1,1,1,0"/>
  269. <Setter Property="BorderThickness" TargetName="mainBorder" Value="1,1,1,0"/>
  270. </MultiDataTrigger>
  271. <MultiDataTrigger>
  272. <MultiDataTrigger.Conditions>
  273. <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="true"/>
  274. <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Top"/>
  275. </MultiDataTrigger.Conditions>
  276. <Setter Property="Panel.ZIndex" Value="1"/>
  277. <Setter Property="Margin" Value="-2,-2,-2,0"/>
  278. <Setter Property="Opacity" TargetName="innerBorder" Value="1"/>
  279. <Setter Property="BorderThickness" TargetName="innerBorder" Value="1,1,1,0"/>
  280. <Setter Property="BorderThickness" TargetName="mainBorder" Value="1,1,1,0"/>
  281. </MultiDataTrigger>
  282. </ControlTemplate.Triggers>
  283. </ControlTemplate>
  284. </Setter.Value>
  285. </Setter>
  286. </Style>
  287. <SolidColorBrush x:Key="TextBox.Static.Border" Color="#FFABAdB3"/>
  288. <SolidColorBrush x:Key="TextBox.MouseOver.Border" Color="#FF7EB4EA"/>
  289. <SolidColorBrush x:Key="TextBox.Focus.Border" Color="#FF569DE5"/>
  290. <Style x:Key="TextBoxStyle1" TargetType="{x:Type TextBox}">
  291. <Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.WindowBrushKey}}"/>
  292. <Setter Property="BorderBrush" Value="{StaticResource TextBox.Static.Border}"/>
  293. <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
  294. <Setter Property="BorderThickness" Value="1"/>
  295. <Setter Property="KeyboardNavigation.TabNavigation" Value="None"/>
  296. <Setter Property="HorizontalContentAlignment" Value="Left"/>
  297. <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
  298. <Setter Property="AllowDrop" Value="true"/>
  299. <Setter Property="ScrollViewer.PanningMode" Value="VerticalFirst"/>
  300. <Setter Property="Stylus.IsFlicksEnabled" Value="False"/>
  301. <Setter Property="Template">
  302. <Setter.Value>
  303. <ControlTemplate TargetType="{x:Type TextBox}">
  304. <Border x:Name="border" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" SnapsToDevicePixels="True">
  305. <Grid>
  306. <ScrollViewer x:Name="PART_ContentHost" Focusable="false" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden"/>
  307. <Button
  308. Name="PART_BtnClear"
  309. Grid.Column="1"
  310. Width="16"
  311. Height="16"
  312. Margin="6,0"
  313. HorizontalAlignment="Right"
  314. VerticalAlignment="Center"
  315. Background="Transparent"
  316. BorderThickness="0"
  317. Click="PART_BtnClear_Click"
  318. Visibility="Collapsed">
  319. <Path
  320. Data="M11.8579 12.5643C12.0532 12.7596 12.3698 12.7596 12.5651 12.5643C12.7603 12.3691 12.7603 12.0525 12.5651 11.8572L8.95882 8.25099L12.5651 4.64475C12.7603 4.44949 12.7603 4.1329 12.5651 3.93764C12.3698 3.74238 12.0532 3.74238 11.858 3.93764L8.25172 7.54389L4.64546 3.93763C4.4502 3.74236 4.13361 3.74236 3.93835 3.93763C3.74309 4.13289 3.74309 4.44947 3.93835 4.64473L7.54461 8.25099L3.93837 11.8572C3.7431 12.0525 3.7431 12.3691 3.93837 12.5643C4.13363 12.7596 4.45021 12.7596 4.64547 12.5643L8.25172 8.9581L11.8579 12.5643Z"
  321. Fill="#43474D"
  322. Stretch="Uniform" />
  323. </Button>
  324. </Grid>
  325. </Border>
  326. <ControlTemplate.Triggers>
  327. <Trigger Property="IsEnabled" Value="false">
  328. <Setter Property="Opacity" TargetName="border" Value="0.56"/>
  329. </Trigger>
  330. <Trigger Property="IsMouseOver" Value="true">
  331. <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource TextBox.MouseOver.Border}"/>
  332. <Setter TargetName="PART_BtnClear" Property="Visibility" Value="Visible" />
  333. </Trigger>
  334. <Trigger Property="IsFocused" Value="True">
  335. <Setter TargetName="PART_BtnClear" Property="Visibility" Value="Visible" />
  336. </Trigger>
  337. <Trigger Property="IsKeyboardFocused" Value="true">
  338. <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource TextBox.Focus.Border}"/>
  339. </Trigger>
  340. <Trigger Property="Text" Value="">
  341. <Setter TargetName="PART_BtnClear" Property="Visibility" Value="Collapsed" />
  342. </Trigger>
  343. <MultiTrigger>
  344. <MultiTrigger.Conditions>
  345. <Condition Property="Text" Value="" />
  346. <Condition Property="IsMouseOver" Value="True" />
  347. </MultiTrigger.Conditions>
  348. <MultiTrigger.Setters>
  349. <Setter TargetName="PART_BtnClear" Property="Visibility" Value="Collapsed" />
  350. </MultiTrigger.Setters>
  351. </MultiTrigger>
  352. </ControlTemplate.Triggers>
  353. </ControlTemplate>
  354. </Setter.Value>
  355. </Setter>
  356. <Style.Triggers>
  357. <MultiTrigger>
  358. <MultiTrigger.Conditions>
  359. <Condition Property="IsInactiveSelectionHighlightEnabled" Value="true"/>
  360. <Condition Property="IsSelectionActive" Value="false"/>
  361. </MultiTrigger.Conditions>
  362. <Setter Property="SelectionBrush" Value="{DynamicResource {x:Static SystemColors.InactiveSelectionHighlightBrushKey}}"/>
  363. </MultiTrigger>
  364. </Style.Triggers>
  365. </Style>
  366. <Style x:Key="FocusVisual1">
  367. <Setter Property="Control.Template">
  368. <Setter.Value>
  369. <ControlTemplate>
  370. <Rectangle Margin="2" StrokeDashArray="1 2" Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" SnapsToDevicePixels="true" StrokeThickness="1"/>
  371. </ControlTemplate>
  372. </Setter.Value>
  373. </Setter>
  374. </Style>
  375. <SolidColorBrush x:Key="Button.Static.Background" Color="#FFDDDDDD"/>
  376. <SolidColorBrush x:Key="Button.Static.Border" Color="#FF707070"/>
  377. <SolidColorBrush x:Key="Button.MouseOver.Background" Color="#FFBEE6FD"/>
  378. <SolidColorBrush x:Key="Button.MouseOver.Border" Color="#FF3C7FB1"/>
  379. <SolidColorBrush x:Key="Button.Pressed.Background" Color="#FFC4E5F6"/>
  380. <SolidColorBrush x:Key="Button.Pressed.Border" Color="#FF2C628B"/>
  381. <SolidColorBrush x:Key="Button.Disabled.Background" Color="#FFF4F4F4"/>
  382. <SolidColorBrush x:Key="Button.Disabled.Border" Color="#FFADB2B5"/>
  383. <SolidColorBrush x:Key="Button.Disabled.Foreground" Color="#FF838383"/>
  384. <Style x:Key="ButtonStyle1" TargetType="{x:Type Button}">
  385. <Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual1}"/>
  386. <Setter Property="Background" Value="{StaticResource Button.Static.Background}"/>
  387. <Setter Property="BorderBrush" Value="{StaticResource Button.Static.Border}"/>
  388. <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
  389. <Setter Property="BorderThickness" Value="1"/>
  390. <Setter Property="HorizontalContentAlignment" Value="Center"/>
  391. <Setter Property="VerticalContentAlignment" Value="Center"/>
  392. <Setter Property="Padding" Value="1"/>
  393. <Setter Property="Template">
  394. <Setter.Value>
  395. <ControlTemplate TargetType="{x:Type Button}">
  396. <Border x:Name="border" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" SnapsToDevicePixels="true">
  397. <ContentPresenter x:Name="contentPresenter" Focusable="False" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
  398. </Border>
  399. <ControlTemplate.Triggers>
  400. <Trigger Property="IsDefaulted" Value="true">
  401. <Setter Property="BorderBrush" TargetName="border" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
  402. </Trigger>
  403. <Trigger Property="IsMouseOver" Value="true">
  404. <Setter Property="Background" TargetName="border" Value="{StaticResource Button.MouseOver.Background}"/>
  405. <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource Button.MouseOver.Border}"/>
  406. </Trigger>
  407. <Trigger Property="IsPressed" Value="true">
  408. <Setter Property="Background" TargetName="border" Value="{StaticResource Button.Pressed.Background}"/>
  409. <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource Button.Pressed.Border}"/>
  410. </Trigger>
  411. <Trigger Property="IsEnabled" Value="false">
  412. <Setter Property="Background" TargetName="border" Value="{StaticResource Button.Disabled.Background}"/>
  413. <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource Button.Disabled.Border}"/>
  414. <Setter Property="TextElement.Foreground" TargetName="contentPresenter" Value="{StaticResource Button.Disabled.Foreground}"/>
  415. </Trigger>
  416. </ControlTemplate.Triggers>
  417. </ControlTemplate>
  418. </Setter.Value>
  419. </Setter>
  420. </Style>
  421. </UserControl.Resources>
  422. <Grid>
  423. <Grid.RowDefinitions>
  424. <RowDefinition Height="auto"></RowDefinition>
  425. <RowDefinition></RowDefinition>
  426. </Grid.RowDefinitions>
  427. <Border BorderThickness="1" BorderBrush="#1A000000">
  428. <Grid Height="40" Background="White" >
  429. <TextBlock x:Name="TitleTextBlock" Text="Link" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="16" FontFamily="Segoe UI"></TextBlock>
  430. </Grid>
  431. </Border>
  432. <ScrollViewer VerticalScrollBarVisibility="Auto" Grid.Row="1">
  433. <Grid Background="#FFFFFF">
  434. <Grid.RowDefinitions>
  435. <RowDefinition Height="100"/>
  436. <RowDefinition Height="*"/>
  437. </Grid.RowDefinitions>
  438. <TabControl x:Name="HeadTabControl" Style="{DynamicResource TabControlStyle1}">
  439. <TabItem Style="{DynamicResource TabItemStyle1}" Header="Hyperlink">
  440. <Grid IsEnabled="{Binding InputEnable}">
  441. <TextBox Style="{DynamicResource TextBoxStyle1}" Height="28" x:Name="UrlText" VerticalContentAlignment="Center" TextChanged="UrlText_TextChanged" VerticalAlignment="Center" Margin="16"/>
  442. <TextBlock Text="https://www.compdf.com/" VerticalAlignment="Center" Margin="22" Visibility="{Binding ElementName=UrlText, Path=Text, Converter={StaticResource TextLengthToVisibilityConverter}}" IsHitTestVisible="False" Foreground="#BBB"></TextBlock>
  443. </Grid>
  444. </TabItem>
  445. <TabItem Style="{DynamicResource TabItemStyle1}" Header="Go To Pages">
  446. <Grid IsEnabled="{Binding InputEnable}">
  447. <TextBox Style="{DynamicResource TextBoxStyle1}" Height="28" x:Name="PageText" VerticalContentAlignment="Center" TextChanged="PageText_TextChanged" VerticalAlignment="Center" Margin="16,0,16,0" Grid.ColumnSpan="2"/>
  448. <TextBlock Text="{Binding PagePromptText, Mode=OneWay}" VerticalAlignment="Center" Margin="22,0,22,0" Visibility="{Binding ElementName=PageText, Path=Text, Converter={StaticResource TextLengthToVisibilityConverter}}" IsHitTestVisible="False" Foreground="#BBB"></TextBlock>
  449. </Grid>
  450. </TabItem>
  451. <TabItem Style="{DynamicResource TabItemStyle1}" Header="Email">
  452. <Grid IsEnabled="{Binding InputEnable}">
  453. <Grid.ColumnDefinitions>
  454. <ColumnDefinition Width="79*"/>
  455. <ColumnDefinition Width="319*"/>
  456. </Grid.ColumnDefinitions>
  457. <TextBox Style="{DynamicResource TextBoxStyle1}" Height="28" x:Name="EmailText" VerticalContentAlignment="Center" TextChanged="EmailText_TextChanged" VerticalAlignment="Center" Margin="16,0,16,0" Grid.ColumnSpan="2"/>
  458. <TextBlock Text="support@compdf.com" VerticalAlignment="Center" Margin="22,0,22,0" Visibility="{Binding ElementName=EmailText, Path=Text, Converter={StaticResource TextLengthToVisibilityConverter}}" IsHitTestVisible="False" Foreground="#BBB" Grid.ColumnSpan="2"></TextBlock>
  459. </Grid>
  460. </TabItem>
  461. </TabControl>
  462. <Button Style="{DynamicResource ButtonStyle1}" x:Name="SaveBtn" Background="#001A4E" Width="120" Height="32" Grid.Row="1" Foreground="#FFFFFF" Content="Save" VerticalAlignment="Top" Click="Save_Click" IsEnabled="False"/>
  463. </Grid>
  464. </ScrollViewer>
  465. </Grid>
  466. </UserControl>