OutLineItemStyle.xaml 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268
  1. <ResourceDictionary
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:dataconvert="clr-namespace:PDF_Office.DataConvert">
  5. <ResourceDictionary.MergedDictionaries>
  6. <ResourceDictionary Source="pack://application:,,,/PDF Office;component/Themes/Alias_Light.xaml" />
  7. </ResourceDictionary.MergedDictionaries>
  8. <PathGeometry x:Key="TreeArrow" Figures="M6 10L11 4H1L6 10Z" />
  9. <PathGeometry x:Key="Ic_MoreButtonPath" Figures="M2,7 C2.140625,7 2.27083333,7.02604167 2.390625,7.078125 C2.51041667,7.13020833 2.61588542,7.20182292 2.70703125,7.29296875 C2.79817708,7.38411458 2.86979167,7.48958333 2.921875,7.609375 C2.97395833,7.72916667 3,7.859375 3,8 C3,8.140625 2.97395833,8.27083333 2.921875,8.390625 C2.86979167,8.51041667 2.79817708,8.61588542 2.70703125,8.70703125 C2.61588542,8.79817708 2.51041667,8.86979167 2.390625,8.921875 C2.27083333,8.97395833 2.140625,9 2,9 C1.859375,9 1.72916667,8.97395833 1.609375,8.921875 C1.48958333,8.86979167 1.38411458,8.79817708 1.29296875,8.70703125 C1.20182292,8.61588542 1.13020833,8.51041667 1.078125,8.390625 C1.02604167,8.27083333 1,8.140625 1,8 C1,7.859375 1.02604167,7.72916667 1.078125,7.609375 C1.13020833,7.48958333 1.20182292,7.38411458 1.29296875,7.29296875 C1.38411458,7.20182292 1.48958333,7.13020833 1.609375,7.078125 C1.72916667,7.02604167 1.859375,7 2,7 Z M8,7 C8.140625,7 8.27083333,7.02604167 8.390625,7.078125 C8.51041667,7.13020833 8.61588542,7.20182292 8.70703125,7.29296875 C8.79817708,7.38411458 8.86979167,7.48958333 8.921875,7.609375 C8.97395833,7.72916667 9,7.859375 9,8 C9,8.140625 8.97395833,8.27083333 8.921875,8.390625 C8.86979167,8.51041667 8.79817708,8.61588542 8.70703125,8.70703125 C8.61588542,8.79817708 8.51041667,8.86979167 8.390625,8.921875 C8.27083333,8.97395833 8.140625,9 8,9 C7.859375,9 7.72916667,8.97395833 7.609375,8.921875 C7.48958333,8.86979167 7.38411458,8.79817708 7.29296875,8.70703125 C7.20182292,8.61588542 7.13020833,8.51041667 7.078125,8.390625 C7.02604167,8.27083333 7,8.140625 7,8 C7,7.859375 7.02604167,7.72916667 7.078125,7.609375 C7.13020833,7.48958333 7.20182292,7.38411458 7.29296875,7.29296875 C7.38411458,7.20182292 7.48958333,7.13020833 7.609375,7.078125 C7.72916667,7.02604167 7.859375,7 8,7 Z M14,7 C14.140625,7 14.2708333,7.02604167 14.390625,7.078125 C14.5104167,7.13020833 14.6158854,7.20182292 14.7070313,7.29296875 C14.7981771,7.38411458 14.8697917,7.48958333 14.921875,7.609375 C14.9739583,7.72916667 15,7.859375 15,8 C15,8.140625 14.9739583,8.27083333 14.921875,8.390625 C14.8697917,8.51041667 14.7981771,8.61588542 14.7070313,8.70703125 C14.6158854,8.79817708 14.5104167,8.86979167 14.390625,8.921875 C14.2708333,8.97395833 14.140625,9 14,9 C13.859375,9 13.7291667,8.97395833 13.609375,8.921875 C13.4895833,8.86979167 13.3841146,8.79817708 13.2929688,8.70703125 C13.2018229,8.61588542 13.1302083,8.51041667 13.078125,8.390625 C13.0260417,8.27083333 13,8.140625 13,8 C13,7.859375 13.0260417,7.72916667 13.078125,7.609375 C13.1302083,7.48958333 13.2018229,7.38411458 13.2929688,7.29296875 C13.3841146,7.20182292 13.4895833,7.13020833 13.609375,7.078125 C13.7291667,7.02604167 13.859375,7 14,7 Z" />
  10. <PathGeometry x:Key="Ic_AddButtonPath" Figures="M13.5 8C13.5 11.0376 11.0376 13.5 8 13.5C4.96243 13.5 2.5 11.0376 2.5 8C2.5 4.96243 4.96243 2.5 8 2.5C11.0376 2.5 13.5 4.96243 13.5 8ZM15 8C15 11.866 11.866 15 8 15C4.13401 15 1 11.866 1 8C1 4.13401 4.13401 1 8 1C11.866 1 15 4.13401 15 8ZM7.25005 4.80003V7.25003H4.80005V8.75003H7.25005V11.2H8.75005V8.75003H11.2V7.25003H8.75005V4.80003H7.25005Z" />
  11. <dataconvert:UnVisivleConvert x:Key="UnVisivleConvert" />
  12. <dataconvert:ListCountToVisible x:Key="ListCountToVisible" />
  13. <dataconvert:BoolToVisible x:Key="BoolToVisible" />
  14. <Style x:Key="FocusVisualRadius0Margin0">
  15. <Setter Property="Control.Template">
  16. <Setter.Value>
  17. <ControlTemplate>
  18. <Rectangle
  19. Opacity=".6"
  20. SnapsToDevicePixels="true"
  21. Stroke="#757575"
  22. StrokeDashArray="1 1"
  23. StrokeThickness="2" />
  24. </ControlTemplate>
  25. </Setter.Value>
  26. </Setter>
  27. </Style>
  28. <Style x:Key="ExpandCollapseToggleStyle" TargetType="ToggleButton">
  29. <Setter Property="Focusable" Value="False" />
  30. <Setter Property="Width" Value="16" />
  31. <Setter Property="Height" Value="16" />
  32. <Setter Property="Template">
  33. <Setter.Value>
  34. <ControlTemplate TargetType="ToggleButton">
  35. <Border
  36. Width="16"
  37. Height="16"
  38. Padding="4"
  39. Background="Transparent">
  40. <Path
  41. x:Name="ExpandPath"
  42. Data="{StaticResource TreeArrow}"
  43. Fill="{Binding Foreground, RelativeSource={RelativeSource AncestorType=TreeViewItem}}"
  44. RenderTransformOrigin="0.5,0.5"
  45. Stretch="Uniform">
  46. <Path.RenderTransform>
  47. <RotateTransform Angle="-90" />
  48. </Path.RenderTransform>
  49. </Path>
  50. </Border>
  51. <ControlTemplate.Triggers>
  52. <Trigger Property="IsChecked" Value="True">
  53. <Setter TargetName="ExpandPath" Property="RenderTransform">
  54. <Setter.Value>
  55. <RotateTransform Angle="0" />
  56. </Setter.Value>
  57. </Setter>
  58. </Trigger>
  59. </ControlTemplate.Triggers>
  60. </ControlTemplate>
  61. </Setter.Value>
  62. </Setter>
  63. </Style>
  64. <Style x:Key="OutLineItemStyle" TargetType="{x:Type TreeViewItem}">
  65. <Setter Property="IsExpanded" Value="{Binding IsExpanded, Mode=TwoWay}" />
  66. <Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}" />
  67. <Setter Property="Background" Value="Transparent" />
  68. <Setter Property="HorizontalContentAlignment" Value="Center" />
  69. <Setter Property="VerticalContentAlignment" Value="Center" />
  70. <Setter Property="Padding" Value="10,0" />
  71. <Setter Property="Foreground" Value="{StaticResource color.icon.base.neutral.norm.lv1}" />
  72. <Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisualRadius0Margin0}" />
  73. <Setter Property="Template">
  74. <Setter.Value>
  75. <ControlTemplate TargetType="{x:Type TreeViewItem}">
  76. <Grid>
  77. <Grid.ColumnDefinitions>
  78. <ColumnDefinition Width="Auto" MinWidth="19" />
  79. <ColumnDefinition Width="Auto" />
  80. <ColumnDefinition Width="*" />
  81. </Grid.ColumnDefinitions>
  82. <Grid.RowDefinitions>
  83. <RowDefinition MinHeight="32" />
  84. <RowDefinition />
  85. </Grid.RowDefinitions>
  86. <Border
  87. x:Name="Bd"
  88. Grid.ColumnSpan="3"
  89. Padding="{TemplateBinding Padding}"
  90. Background="{TemplateBinding Background}"
  91. BorderBrush="{TemplateBinding BorderBrush}"
  92. BorderThickness="{TemplateBinding BorderThickness}"
  93. CornerRadius="4"
  94. SnapsToDevicePixels="True">
  95. <Grid>
  96. <DockPanel x:Name="PART_DockPanel" LastChildFill="True">
  97. <ToggleButton
  98. x:Name="Expander"
  99. ClickMode="Press"
  100. IsChecked="{Binding IsExpanded, RelativeSource={RelativeSource TemplatedParent}}"
  101. Style="{StaticResource ExpandCollapseToggleStyle}" />
  102. <ContentPresenter
  103. x:Name="PART_Header"
  104. ContentSource="Header"
  105. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  106. </DockPanel>
  107. <StackPanel
  108. Margin="0,0,0,0"
  109. Orientation="Horizontal"
  110. Visibility="{Binding IsInsertCurrentLayer, Converter={StaticResource BoolToVisible}}">
  111. <Ellipse
  112. Width="8"
  113. Height="8"
  114. HorizontalAlignment="Stretch"
  115. VerticalAlignment="Bottom"
  116. Fill="White"
  117. Stroke="#FF0078D7"
  118. StrokeThickness="1.5" />
  119. <Rectangle
  120. Width="{Binding ElementName=PART_DockPanel, Path=ActualWidth}"
  121. Height="1.5"
  122. Margin="-1,0,0,2"
  123. HorizontalAlignment="Stretch"
  124. VerticalAlignment="Bottom"
  125. Fill="#FF0078D7"
  126. StrokeDashArray="2" />
  127. </StackPanel>
  128. </Grid>
  129. </Border>
  130. <ItemsPresenter
  131. x:Name="ItemsHost"
  132. Grid.Row="1"
  133. Grid.Column="1"
  134. Grid.ColumnSpan="2" />
  135. </Grid>
  136. <ControlTemplate.Triggers>
  137. <Trigger Property="IsExpanded" Value="False">
  138. <Setter TargetName="ItemsHost" Property="Visibility" Value="Collapsed" />
  139. </Trigger>
  140. <Trigger Property="HasItems" Value="False">
  141. <Setter TargetName="Expander" Property="Visibility" Value="Hidden" />
  142. </Trigger>
  143. <Trigger Property="IsSelected" Value="True">
  144. <Setter TargetName="Bd" Property="Background" Value="{StaticResource color.item-state.sel.bg.lv3}" />
  145. <Setter Property="Foreground" Value="Black" />
  146. </Trigger>
  147. <Trigger SourceName="Bd" Property="IsMouseOver" Value="True">
  148. <Setter TargetName="Bd" Property="Background" Value="{StaticResource color.item-state.hov.bg}" />
  149. <Setter Property="Foreground" Value="Black" />
  150. </Trigger>
  151. <MultiTrigger>
  152. <MultiTrigger.Conditions>
  153. <Condition Property="IsSelected" Value="True" />
  154. <Condition Property="IsSelectionActive" Value="False" />
  155. </MultiTrigger.Conditions>
  156. <Setter TargetName="Bd" Property="Background" Value="{DynamicResource {x:Static SystemColors.InactiveSelectionHighlightBrushKey}}" />
  157. <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.InactiveSelectionHighlightTextBrushKey}}" />
  158. </MultiTrigger>
  159. </ControlTemplate.Triggers>
  160. </ControlTemplate>
  161. </Setter.Value>
  162. </Setter>
  163. <Style.Triggers>
  164. <Trigger Property="VirtualizingPanel.IsVirtualizing" Value="True">
  165. <Setter Property="ItemsPanel">
  166. <Setter.Value>
  167. <ItemsPanelTemplate>
  168. <VirtualizingStackPanel IsItemsHost="True" />
  169. </ItemsPanelTemplate>
  170. </Setter.Value>
  171. </Setter>
  172. </Trigger>
  173. </Style.Triggers>
  174. </Style>
  175. <SolidColorBrush x:Key="TextBox.Static.Border" Color="#FFABAdB3" />
  176. <SolidColorBrush x:Key="TextBox.MouseOver.Border" Color="#FF7EB4EA" />
  177. <SolidColorBrush x:Key="TextBox.Focus.Border" Color="#FF569DE5" />
  178. <Style x:Key="TextBoxStyleRadius" TargetType="{x:Type TextBox}">
  179. <Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.WindowBrushKey}}" />
  180. <Setter Property="BorderBrush" Value="{StaticResource TextBox.Static.Border}" />
  181. <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
  182. <Setter Property="BorderThickness" Value="1" />
  183. <Setter Property="KeyboardNavigation.TabNavigation" Value="None" />
  184. <Setter Property="HorizontalContentAlignment" Value="Left" />
  185. <Setter Property="FocusVisualStyle" Value="{x:Null}" />
  186. <Setter Property="AllowDrop" Value="true" />
  187. <Setter Property="ScrollViewer.PanningMode" Value="VerticalFirst" />
  188. <Setter Property="Stylus.IsFlicksEnabled" Value="False" />
  189. <Setter Property="Template">
  190. <Setter.Value>
  191. <ControlTemplate TargetType="{x:Type TextBox}">
  192. <Border
  193. x:Name="border"
  194. Background="{TemplateBinding Background}"
  195. BorderBrush="{TemplateBinding BorderBrush}"
  196. BorderThickness="{TemplateBinding BorderThickness}"
  197. CornerRadius="4"
  198. SnapsToDevicePixels="True">
  199. <ScrollViewer
  200. x:Name="PART_ContentHost"
  201. Focusable="false"
  202. HorizontalScrollBarVisibility="Hidden"
  203. VerticalScrollBarVisibility="Hidden" />
  204. </Border>
  205. <ControlTemplate.Triggers>
  206. <Trigger Property="IsEnabled" Value="false">
  207. <Setter TargetName="border" Property="Opacity" Value="0.56" />
  208. </Trigger>
  209. <Trigger Property="IsMouseOver" Value="true">
  210. <Setter TargetName="border" Property="BorderBrush" Value="{StaticResource TextBox.MouseOver.Border}" />
  211. </Trigger>
  212. <Trigger Property="IsKeyboardFocused" Value="true">
  213. <Setter TargetName="border" Property="BorderBrush" Value="{StaticResource TextBox.Focus.Border}" />
  214. </Trigger>
  215. </ControlTemplate.Triggers>
  216. </ControlTemplate>
  217. </Setter.Value>
  218. </Setter>
  219. <Style.Triggers>
  220. <MultiTrigger>
  221. <MultiTrigger.Conditions>
  222. <Condition Property="IsInactiveSelectionHighlightEnabled" Value="true" />
  223. <Condition Property="IsSelectionActive" Value="false" />
  224. </MultiTrigger.Conditions>
  225. <Setter Property="SelectionBrush" Value="{DynamicResource {x:Static SystemColors.InactiveSelectionHighlightBrushKey}}" />
  226. </MultiTrigger>
  227. </Style.Triggers>
  228. </Style>
  229. <Style x:Key="ErrorRoundedTooltip" TargetType="ToolTip">
  230. <Setter Property="OverridesDefaultStyle" Value="true" />
  231. <Setter Property="HasDropShadow" Value="True" />
  232. <Setter Property="Template">
  233. <Setter.Value>
  234. <ControlTemplate TargetType="ToolTip">
  235. <Border
  236. Name="Border"
  237. Width="{TemplateBinding Width}"
  238. Height="{TemplateBinding Height}"
  239. BorderBrush="{StaticResource color.sys.border.neutral.lv1}"
  240. BorderThickness="2"
  241. CornerRadius="8">
  242. <Grid>
  243. <Border
  244. Name="myBorder"
  245. Margin="1"
  246. Background="White"
  247. CornerRadius="8" />
  248. <ContentPresenter HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
  249. <ContentPresenter.OpacityMask>
  250. <VisualBrush Visual="{x:Reference Name=myBorder}" />
  251. </ContentPresenter.OpacityMask>
  252. </ContentPresenter>
  253. </Grid>
  254. </Border>
  255. </ControlTemplate>
  256. </Setter.Value>
  257. </Setter>
  258. </Style>
  259. </ResourceDictionary>