Generic.xaml 18 KB

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