CPDFLinkUI.xaml 39 KB

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