Generic.xaml 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281
  1. <ResourceDictionary
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:cus="clr-namespace:PDF_Office.CustomControl"
  5. xmlns:local="clr-namespace:PDF_Office">
  6. <!-- style for customControl -->
  7. <Style TargetType="{x:Type cus:DialogContent}">
  8. <Setter Property="Template">
  9. <Setter.Value>
  10. <ControlTemplate TargetType="{x:Type cus:DialogContent}">
  11. <Border Background="White" CornerRadius="8">
  12. <Grid Background="Transparent">
  13. <Grid.RowDefinitions>
  14. <RowDefinition Height="48" />
  15. <RowDefinition Height="*" />
  16. <RowDefinition Height="64" />
  17. </Grid.RowDefinitions>
  18. <Border Background="Transparent" BorderThickness="0,0,0,1">
  19. <Border.BorderBrush>
  20. <SolidColorBrush Opacity="0.2" Color="Gray" />
  21. </Border.BorderBrush>
  22. <TextBlock
  23. Margin="16,0,0,0"
  24. VerticalAlignment="Center"
  25. FontSize="16"
  26. FontWeight="SemiBold"
  27. Text="{TemplateBinding Header}" />
  28. </Border>
  29. <ContentPresenter Grid.Row="1" Content="{TemplateBinding Content}" />
  30. <Border Grid.Row="2" BorderThickness="0,1,0,0">
  31. <Border.BorderBrush>
  32. <SolidColorBrush Opacity="0.2" Color="Gray" />
  33. </Border.BorderBrush>
  34. <ContentControl Content="{TemplateBinding BottmBar}" />
  35. </Border>
  36. </Grid>
  37. </Border>
  38. </ControlTemplate>
  39. </Setter.Value>
  40. </Setter>
  41. </Style>
  42. <Style TargetType="{x:Type cus:TextBoxEx}">
  43. <Setter Property="Background" Value="{StaticResource color.field.bg.def}" />
  44. <Setter Property="BorderBrush" Value="{StaticResource color.field.border.norm}" />
  45. <Setter Property="Foreground" Value="Black" />
  46. <Setter Property="BorderThickness" Value="1" />
  47. <Setter Property="FocusVisualStyle" Value="{x:Null}" />
  48. <Setter Property="Template">
  49. <Setter.Value>
  50. <ControlTemplate TargetType="{x:Type cus:TextBoxEx}">
  51. <Border
  52. x:Name="border"
  53. Width="{TemplateBinding Width}"
  54. Height="{TemplateBinding Height}"
  55. Background="{TemplateBinding Background}"
  56. BorderBrush="{TemplateBinding BorderBrush}"
  57. BorderThickness="{TemplateBinding BorderThickness}"
  58. CornerRadius="{TemplateBinding CornerRadius}"
  59. SnapsToDevicePixels="True">
  60. <Grid Margin="{TemplateBinding Padding}">
  61. <TextBlock
  62. x:Name="placeholder"
  63. Margin="5,0,0,0"
  64. FontSize="{TemplateBinding FontSize}"
  65. Foreground="{TemplateBinding PlaceholderForeground}"
  66. Text="{TemplateBinding PlaceholderText}"
  67. Visibility="Collapsed" />
  68. <ScrollViewer
  69. x:Name="PART_ContentHost"
  70. Margin="0,0,25,0"
  71. Padding="8,1,0,0"
  72. Focusable="false"
  73. Foreground="{TemplateBinding Foreground}"
  74. HorizontalScrollBarVisibility="Hidden"
  75. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
  76. Style="{x:Null}"
  77. VerticalScrollBarVisibility="Hidden" />
  78. <Button
  79. Name="PART_BtnClear"
  80. Width="16"
  81. Height="16"
  82. Margin="9,0"
  83. HorizontalAlignment="Right"
  84. VerticalAlignment="Center"
  85. Background="Transparent"
  86. BorderThickness="0"
  87. Style="{StaticResource NoColorBtn}"
  88. Visibility="Collapsed">
  89. <Path
  90. Data="M8 15C11.866 15 15 11.866 15 8C15 4.13401 11.866 1 8 1C4.13401 1 1 4.13401 1 8C1 11.866 4.13401 15 8 15ZM11.5303 5.53038L9.06069 8L11.5303 10.4696L10.4697 11.5303L8.00002 9.06066L5.53033 11.5303L4.46967 10.4697L6.93936 8L4.46967 5.53033L5.53033 4.46967L8.00002 6.93934L10.4697 4.46971L11.5303 5.53038Z"
  91. Fill="#CED0D4"
  92. Stretch="Uniform" />
  93. </Button>
  94. </Grid>
  95. </Border>
  96. <ControlTemplate.Triggers>
  97. <Trigger Property="IsEnabled" Value="false">
  98. <Setter TargetName="border" Property="Opacity" Value="0.56" />
  99. </Trigger>
  100. <Trigger Property="Text" Value="{x:Null}">
  101. <Setter TargetName="placeholder" Property="Visibility" Value="Visible" />
  102. </Trigger>
  103. <Trigger Property="Text" Value="">
  104. <Setter TargetName="placeholder" Property="Visibility" Value="Visible" />
  105. </Trigger>
  106. <Trigger Property="IsMouseOver" Value="True">
  107. <Setter TargetName="PART_BtnClear" Property="Visibility" Value="Visible" />
  108. </Trigger>
  109. <MultiTrigger>
  110. <MultiTrigger.Conditions>
  111. <Condition Property="Text" Value="" />
  112. <Condition Property="IsMouseOver" Value="True" />
  113. </MultiTrigger.Conditions>
  114. <MultiTrigger.Setters>
  115. <Setter TargetName="PART_BtnClear" Property="Visibility" Value="Collapsed" />
  116. </MultiTrigger.Setters>
  117. </MultiTrigger>
  118. </ControlTemplate.Triggers>
  119. </ControlTemplate>
  120. </Setter.Value>
  121. </Setter>
  122. <Style.Triggers>
  123. <MultiTrigger>
  124. <MultiTrigger.Conditions>
  125. <Condition Property="IsInactiveSelectionHighlightEnabled" Value="true" />
  126. <Condition Property="IsSelectionActive" Value="false" />
  127. </MultiTrigger.Conditions>
  128. <Setter Property="SelectionBrush" Value="{DynamicResource {x:Static SystemColors.InactiveSelectionHighlightBrushKey}}" />
  129. </MultiTrigger>
  130. </Style.Triggers>
  131. </Style>
  132. <Style TargetType="{x:Type cus:MenuItemWithPath}">
  133. <Setter Property="Foreground" Value="{StaticResource color.sys.text.neutral.lv1}" />
  134. <Setter Property="Background" Value="Transparent" />
  135. <Setter Property="Height" Value="32" />
  136. <Setter Property="Margin" Value="8,0" />
  137. <Setter Property="Template">
  138. <Setter.Value>
  139. <ControlTemplate TargetType="{x:Type cus:MenuItemWithPath}">
  140. <Border
  141. x:Name="Border"
  142. Background="{TemplateBinding Background}"
  143. BorderBrush="{TemplateBinding BorderBrush}"
  144. BorderThickness="0"
  145. CornerRadius="7">
  146. <Grid>
  147. <Grid.ColumnDefinitions>
  148. <ColumnDefinition
  149. x:Name="ColIcon"
  150. Width="Auto"
  151. SharedSizeGroup="MenuItemIconColumnGroup" />
  152. <ColumnDefinition Width="Auto" SharedSizeGroup="MenuTextColumnGroup" />
  153. <ColumnDefinition Width="Auto" SharedSizeGroup="MenuItemIGTColumnGroup" />
  154. <ColumnDefinition x:Name="ColNext" Width="auto" />
  155. </Grid.ColumnDefinitions>
  156. <Path
  157. x:Name="Icon"
  158. Grid.Column="0"
  159. Width="{TemplateBinding PathWidth}"
  160. Height="{TemplateBinding PathHeight}"
  161. Margin="5,0"
  162. Data="{TemplateBinding Path}"
  163. Fill="{TemplateBinding Foreground}" />
  164. <Grid
  165. x:Name="GlyphPanel"
  166. Grid.Column="0"
  167. Margin="5,0"
  168. VerticalAlignment="Center"
  169. Visibility="Collapsed">
  170. <Viewbox
  171. Width="18"
  172. Height="18"
  173. VerticalAlignment="Center"
  174. FlowDirection="LeftToRight">
  175. <Path Data="M422.36247 839.786465c-13.320377 13.421684-34.909068 13.421684-48.126091 0l-10.69355-10.800997 0 0-11.398608-11.502985-50.145074-50.544163c-0.097214-0.201591 0-0.500397-0.201591-0.604774L72.380494 533.085224c-13.320377-13.421684-13.320377-35.218106 0-48.535413l72.132854-72.842005c13.319353-13.408381 34.907021-13.408381 48.224328 0l205.814506 209.252815L831.363631 184.208419c13.218046-13.414521 34.806737-13.414521 48.124044 0l72.134901 72.842005c13.317307 13.408381 13.317307 35.113729 0 48.52211L422.36247 839.786465 422.36247 839.786465z" Fill="{TemplateBinding Foreground}" />
  176. </Viewbox>
  177. </Grid>
  178. <ContentPresenter
  179. x:Name="HeaderHost"
  180. Grid.Column="1"
  181. Margin="{TemplateBinding Padding}"
  182. VerticalAlignment="Center"
  183. ContentSource="Header"
  184. RecognizesAccessKey="True" />
  185. <ContentPresenter
  186. x:Name="IGTHost"
  187. Grid.Column="2"
  188. Margin="8,0"
  189. VerticalAlignment="Center"
  190. ContentSource="InputGestureText" />
  191. <Grid
  192. x:Name="ArrowPanel"
  193. Grid.Column="3"
  194. Margin="10,0"
  195. HorizontalAlignment="Right"
  196. VerticalAlignment="Center">
  197. <Path
  198. x:Name="ArrowPanelPath"
  199. HorizontalAlignment="Right"
  200. VerticalAlignment="Center"
  201. Data="M0,0 L0,8 L4,4 z"
  202. Fill="{TemplateBinding Foreground}" />
  203. </Grid>
  204. <Popup
  205. x:Name="SubMenuPopup"
  206. AllowsTransparency="True"
  207. Focusable="false"
  208. IsOpen="{Binding Path=IsSubmenuOpen, RelativeSource={RelativeSource TemplatedParent}}"
  209. Placement="Right">
  210. <Border
  211. x:Name="SubMenuBorder"
  212. Padding="2,2,2,2"
  213. Background="#1D1D1D"
  214. BorderBrush="#999999"
  215. BorderThickness="0"
  216. CornerRadius="7">
  217. <Grid x:Name="SubMenu" Grid.IsSharedSizeScope="True">
  218. <StackPanel IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Cycle" />
  219. </Grid>
  220. </Border>
  221. </Popup>
  222. </Grid>
  223. </Border>
  224. <ControlTemplate.Triggers>
  225. <Trigger Property="Role" Value="TopLevelHeader">
  226. <Setter Property="Padding" Value="6,1" />
  227. <Setter Property="Background" Value="Transparent" />
  228. <Setter TargetName="SubMenuPopup" Property="Placement" Value="Bottom" />
  229. <Setter TargetName="ColIcon" Property="MinWidth" Value="0" />
  230. <Setter TargetName="ColNext" Property="Width" Value="Auto" />
  231. <Setter TargetName="Icon" Property="Visibility" Value="Collapsed" />
  232. <Setter TargetName="GlyphPanel" Property="Visibility" Value="Collapsed" />
  233. <Setter TargetName="IGTHost" Property="Visibility" Value="Collapsed" />
  234. <Setter TargetName="ArrowPanel" Property="Visibility" Value="Collapsed" />
  235. </Trigger>
  236. <Trigger Property="IsHighlighted" Value="true">
  237. <Setter TargetName="Border" Property="Background" Value="{StaticResource color.item-state.sel.bg.lv1}" />
  238. <Setter Property="Foreground" Value="{StaticResource color.sys.text.accent.norm}" />
  239. </Trigger>
  240. <MultiTrigger>
  241. <MultiTrigger.Conditions>
  242. <Condition Property="IsHighlighted" Value="True" />
  243. <Condition Property="Role" Value="TopLevelHeader" />
  244. </MultiTrigger.Conditions>
  245. <MultiTrigger.Setters>
  246. <Setter TargetName="Border" Property="Background" Value="#0cffffff" />
  247. </MultiTrigger.Setters>
  248. </MultiTrigger>
  249. <Trigger Property="Role" Value="TopLevelItem">
  250. <Setter Property="Padding" Value="6,1" />
  251. <Setter TargetName="ArrowPanel" Property="Visibility" Value="Collapsed" />
  252. </Trigger>
  253. <Trigger Property="Role" Value="SubmenuHeader">
  254. <Setter Property="Padding" Value="5,2" />
  255. </Trigger>
  256. <Trigger Property="Path" Value="{x:Null}">
  257. <Setter TargetName="Icon" Property="Visibility" Value="Collapsed" />
  258. </Trigger>
  259. <Trigger Property="Role" Value="SubmenuItem">
  260. <Setter Property="Padding" Value="5,2" />
  261. <Setter TargetName="ArrowPanel" Property="Visibility" Value="Collapsed" />
  262. </Trigger>
  263. <Trigger Property="IsChecked" Value="true">
  264. <Setter TargetName="GlyphPanel" Property="Visibility" Value="Visible" />
  265. <Setter TargetName="Icon" Property="Visibility" Value="Collapsed" />
  266. </Trigger>
  267. <Trigger Property="IsEnabled" Value="false">
  268. <Setter Property="Foreground" Value="{StaticResource color.sys.text.neutral.dis}" />
  269. </Trigger>
  270. </ControlTemplate.Triggers>
  271. </ControlTemplate>
  272. </Setter.Value>
  273. </Setter>
  274. </Style>
  275. </ResourceDictionary>