Generic.xaml 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300
  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="VerticalContentAlignment" Value="Center" />
  47. <Setter Property="BorderThickness" Value="1" />
  48. <Setter Property="FocusVisualStyle" Value="{x:Null}" />
  49. <Setter Property="Template">
  50. <Setter.Value>
  51. <ControlTemplate TargetType="{x:Type cus:TextBoxEx}">
  52. <Border
  53. x:Name="border"
  54. Width="{TemplateBinding Width}"
  55. Height="32"
  56. Background="{TemplateBinding Background}"
  57. BorderBrush="{TemplateBinding BorderBrush}"
  58. BorderThickness="{TemplateBinding BorderThickness}"
  59. CornerRadius="{TemplateBinding CornerRadius}"
  60. SnapsToDevicePixels="True">
  61. <Grid Margin="{TemplateBinding Padding}">
  62. <TextBlock
  63. x:Name="placeholder"
  64. Margin="5,0,0,0"
  65. Padding="{TemplateBinding Padding}"
  66. FontSize="{TemplateBinding FontSize}"
  67. Foreground="{TemplateBinding PlaceholderForeground}"
  68. Text="{TemplateBinding PlaceholderText}"
  69. Visibility="Collapsed" />
  70. <ScrollViewer
  71. x:Name="PART_ContentHost"
  72. Margin="8,0,25,0"
  73. Focusable="false"
  74. Foreground="{TemplateBinding Foreground}"
  75. HorizontalScrollBarVisibility="Hidden"
  76. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
  77. Style="{x:Null}"
  78. VerticalScrollBarVisibility="Hidden" />
  79. <Button
  80. Name="PART_BtnClear"
  81. Width="16"
  82. Height="16"
  83. Margin="9,0"
  84. HorizontalAlignment="Right"
  85. VerticalAlignment="Center"
  86. Background="Transparent"
  87. BorderThickness="0"
  88. Style="{StaticResource NoColorBtn}"
  89. Visibility="Collapsed">
  90. <Path
  91. 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"
  92. Fill="#CED0D4"
  93. Stretch="Uniform" />
  94. </Button>
  95. </Grid>
  96. </Border>
  97. <ControlTemplate.Triggers>
  98. <Trigger Property="IsEnabled" Value="false">
  99. <Setter TargetName="border" Property="Opacity" Value="0.56" />
  100. </Trigger>
  101. <Trigger Property="Text" Value="{x:Null}">
  102. <Setter TargetName="placeholder" Property="Visibility" Value="Visible" />
  103. </Trigger>
  104. <Trigger Property="IsMouseOver" Value="True">
  105. <Setter TargetName="PART_BtnClear" Property="Visibility" Value="Visible" />
  106. <Setter Property="BorderBrush" Value="{StaticResource color.field.border.hov}" />
  107. </Trigger>
  108. <Trigger Property="IsFocused" Value="True">
  109. <Setter TargetName="PART_BtnClear" Property="Visibility" Value="Visible" />
  110. <Setter Property="BorderBrush" Value="{StaticResource color.field.border.focus}" />
  111. <Setter TargetName="border" Property="Effect" Value="{StaticResource shadow.blue-0-4}" />
  112. </Trigger>
  113. <MultiTrigger>
  114. <MultiTrigger.Conditions>
  115. <Condition Property="IsFocused" Value="True" />
  116. <Condition Property="IsError" Value="True" />
  117. </MultiTrigger.Conditions>
  118. <MultiTrigger.Setters>
  119. <Setter TargetName="border" Property="Effect" Value="{StaticResource shadow.error.s}" />
  120. </MultiTrigger.Setters>
  121. </MultiTrigger>
  122. <Trigger Property="IsError" Value="True">
  123. <Setter Property="BorderBrush" Value="{StaticResource color.sys.border.error}" />
  124. </Trigger>
  125. <Trigger Property="Text" Value="">
  126. <Setter TargetName="placeholder" Property="Visibility" Value="Visible" />
  127. <Setter TargetName="PART_BtnClear" Property="Visibility" Value="Collapsed" />
  128. </Trigger>
  129. <MultiTrigger>
  130. <MultiTrigger.Conditions>
  131. <Condition Property="Text" Value="" />
  132. <Condition Property="IsMouseOver" Value="True" />
  133. </MultiTrigger.Conditions>
  134. <MultiTrigger.Setters>
  135. <Setter TargetName="PART_BtnClear" Property="Visibility" Value="Collapsed" />
  136. </MultiTrigger.Setters>
  137. </MultiTrigger>
  138. </ControlTemplate.Triggers>
  139. </ControlTemplate>
  140. </Setter.Value>
  141. </Setter>
  142. <Style.Triggers>
  143. <MultiTrigger>
  144. <MultiTrigger.Conditions>
  145. <Condition Property="IsInactiveSelectionHighlightEnabled" Value="true" />
  146. <Condition Property="IsSelectionActive" Value="false" />
  147. </MultiTrigger.Conditions>
  148. <Setter Property="SelectionBrush" Value="{DynamicResource {x:Static SystemColors.InactiveSelectionHighlightBrushKey}}" />
  149. </MultiTrigger>
  150. </Style.Triggers>
  151. </Style>
  152. <Style TargetType="{x:Type cus:MenuItemWithPath}">
  153. <Setter Property="Foreground" Value="{StaticResource color.sys.text.neutral.lv1}" />
  154. <Setter Property="Background" Value="Transparent" />
  155. <Setter Property="Height" Value="32" />
  156. <Setter Property="Margin" Value="8,0" />
  157. <Setter Property="Template">
  158. <Setter.Value>
  159. <ControlTemplate TargetType="{x:Type cus:MenuItemWithPath}">
  160. <Border
  161. x:Name="Border"
  162. Background="{TemplateBinding Background}"
  163. BorderBrush="{TemplateBinding BorderBrush}"
  164. BorderThickness="0"
  165. CornerRadius="7">
  166. <Grid>
  167. <Grid.ColumnDefinitions>
  168. <ColumnDefinition
  169. x:Name="ColIcon"
  170. Width="Auto"
  171. SharedSizeGroup="MenuItemIconColumnGroup" />
  172. <ColumnDefinition Width="Auto" SharedSizeGroup="MenuTextColumnGroup" />
  173. <ColumnDefinition Width="Auto" SharedSizeGroup="MenuItemIGTColumnGroup" />
  174. <ColumnDefinition x:Name="ColNext" Width="auto" />
  175. </Grid.ColumnDefinitions>
  176. <Path
  177. x:Name="Icon"
  178. Grid.Column="0"
  179. Width="{TemplateBinding PathWidth}"
  180. Height="{TemplateBinding PathHeight}"
  181. Margin="5,0"
  182. Data="{TemplateBinding Path}"
  183. Fill="{TemplateBinding Foreground}" />
  184. <Grid
  185. x:Name="GlyphPanel"
  186. Grid.Column="0"
  187. Margin="5,0"
  188. VerticalAlignment="Center"
  189. Visibility="Collapsed">
  190. <Viewbox
  191. Width="18"
  192. Height="18"
  193. VerticalAlignment="Center"
  194. FlowDirection="LeftToRight">
  195. <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}" />
  196. </Viewbox>
  197. </Grid>
  198. <ContentPresenter
  199. x:Name="HeaderHost"
  200. Grid.Column="1"
  201. Margin="{TemplateBinding Padding}"
  202. VerticalAlignment="Center"
  203. ContentSource="Header"
  204. RecognizesAccessKey="True" />
  205. <ContentPresenter
  206. x:Name="IGTHost"
  207. Grid.Column="2"
  208. Margin="8,0"
  209. VerticalAlignment="Center"
  210. ContentSource="InputGestureText" />
  211. <Grid
  212. x:Name="ArrowPanel"
  213. Grid.Column="3"
  214. Margin="10,0"
  215. HorizontalAlignment="Right"
  216. VerticalAlignment="Center">
  217. <Path
  218. x:Name="ArrowPanelPath"
  219. HorizontalAlignment="Right"
  220. VerticalAlignment="Center"
  221. Data="M0,0 L0,8 L4,4 z"
  222. Fill="{TemplateBinding Foreground}" />
  223. </Grid>
  224. <Popup
  225. x:Name="SubMenuPopup"
  226. AllowsTransparency="True"
  227. Focusable="false"
  228. IsOpen="{Binding Path=IsSubmenuOpen, RelativeSource={RelativeSource TemplatedParent}}"
  229. Placement="Right">
  230. <Border
  231. x:Name="SubMenuBorder"
  232. Padding="2,2,2,2"
  233. Background="#1D1D1D"
  234. BorderBrush="#999999"
  235. BorderThickness="0"
  236. CornerRadius="7">
  237. <Grid x:Name="SubMenu" Grid.IsSharedSizeScope="True">
  238. <StackPanel IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Cycle" />
  239. </Grid>
  240. </Border>
  241. </Popup>
  242. </Grid>
  243. </Border>
  244. <ControlTemplate.Triggers>
  245. <Trigger Property="Role" Value="TopLevelHeader">
  246. <Setter Property="Padding" Value="6,1" />
  247. <Setter Property="Background" Value="Transparent" />
  248. <Setter TargetName="SubMenuPopup" Property="Placement" Value="Bottom" />
  249. <Setter TargetName="ColIcon" Property="MinWidth" Value="0" />
  250. <Setter TargetName="ColNext" Property="Width" Value="Auto" />
  251. <Setter TargetName="Icon" Property="Visibility" Value="Collapsed" />
  252. <Setter TargetName="GlyphPanel" Property="Visibility" Value="Collapsed" />
  253. <Setter TargetName="IGTHost" Property="Visibility" Value="Collapsed" />
  254. <Setter TargetName="ArrowPanel" Property="Visibility" Value="Collapsed" />
  255. </Trigger>
  256. <Trigger Property="IsHighlighted" Value="true">
  257. <Setter TargetName="Border" Property="Background" Value="{StaticResource color.item-state.sel.bg.lv1}" />
  258. <Setter Property="Foreground" Value="{StaticResource color.sys.text.accent.norm}" />
  259. </Trigger>
  260. <MultiTrigger>
  261. <MultiTrigger.Conditions>
  262. <Condition Property="IsHighlighted" Value="True" />
  263. <Condition Property="Role" Value="TopLevelHeader" />
  264. </MultiTrigger.Conditions>
  265. <MultiTrigger.Setters>
  266. <Setter TargetName="Border" Property="Background" Value="#0cffffff" />
  267. </MultiTrigger.Setters>
  268. </MultiTrigger>
  269. <Trigger Property="Role" Value="TopLevelItem">
  270. <Setter Property="Padding" Value="6,1" />
  271. <Setter TargetName="ArrowPanel" Property="Visibility" Value="Collapsed" />
  272. </Trigger>
  273. <Trigger Property="Role" Value="SubmenuHeader">
  274. <Setter Property="Padding" Value="5,2" />
  275. </Trigger>
  276. <Trigger Property="Path" Value="{x:Null}">
  277. <Setter TargetName="Icon" Property="Visibility" Value="Collapsed" />
  278. </Trigger>
  279. <Trigger Property="Role" Value="SubmenuItem">
  280. <Setter Property="Padding" Value="5,2" />
  281. <Setter TargetName="ArrowPanel" Property="Visibility" Value="Collapsed" />
  282. </Trigger>
  283. <Trigger Property="IsChecked" Value="true">
  284. <Setter TargetName="GlyphPanel" Property="Visibility" Value="Visible" />
  285. <Setter TargetName="Icon" Property="Visibility" Value="Collapsed" />
  286. </Trigger>
  287. <Trigger Property="IsEnabled" Value="false">
  288. <Setter Property="Foreground" Value="{StaticResource color.sys.text.neutral.dis}" />
  289. </Trigger>
  290. </ControlTemplate.Triggers>
  291. </ControlTemplate>
  292. </Setter.Value>
  293. </Setter>
  294. </Style>
  295. </ResourceDictionary>