App.xaml 57 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828
  1. <prism:PrismApplication
  2. x:Class="PDF_Office.App"
  3. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  4. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5. xmlns:Themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero2"
  6. xmlns:local="clr-namespace:PDF_Office"
  7. xmlns:prism="http://prismlibrary.com/"
  8. xmlns:sys="clr-namespace:System;assembly=mscorlib">
  9. <Application.Resources>
  10. <ResourceDictionary>
  11. <ResourceDictionary.MergedDictionaries>
  12. <ResourceDictionary Source="pack://application:,,,/PDF Office;component/Themes/Alias_Light.xaml" />
  13. <ResourceDictionary Source="pack://application:,,,/PDF Office;component/Themes/Global.xaml" />
  14. <ResourceDictionary Source="pack://application:,,,/PDF Office;component/Styles/TabControlStyle.xaml" />
  15. <ResourceDictionary Source="pack://application:,,,/PDF Office;component/Styles/ButtonStyle.xaml" />
  16. <ResourceDictionary Source="pack://application:,,,/PDF Office;component/Styles/ToggleButton.xaml" />
  17. <ResourceDictionary Source="pack://application:,,,/PDF Office;component/Styles/TextBoxStyle.xaml" />
  18. <ResourceDictionary Source="pack://application:,,,/PDF Office;component/Styles/ComboxStyle.xaml" />
  19. <ResourceDictionary Source="pack://application:,,,/PDF Office;component/Styles/ListBoxStyle.xaml" />
  20. <ResourceDictionary Source="pack://application:,,,/PDF Office;component/Styles/WindowsStyle.xaml" />
  21. <ResourceDictionary Source="pack://application:,,,/PDF Office;component/Styles/CustomBtnStyle.xaml" />
  22. <ResourceDictionary Source="pack://application:,,,/PDF Office;component/Styles/ContainerStyles/ComboxStyle/ComboxItemStyle.xaml" />
  23. <ResourceDictionary Source="pack://application:,,,/PDF Office;component/Styles/PathButtonStyle.xaml" />
  24. <ResourceDictionary Source="pack://application:,,,/PDF Office;component/Styles/ImageButtonStyle.xaml" />
  25. <ResourceDictionary Source="pack://application:,,,/PDF Office;component/Styles/PathRadioButtonDictionary.xaml" />
  26. <ResourceDictionary Source="pack://application:,,,/PDF Office;component/Styles/ImageRadioButtonDictionary.xaml" />
  27. <ResourceDictionary Source="pack://application:,,,/PDF Office;component/Styles/ContextMenuTextEditStyle.xaml" />
  28. <ResourceDictionary Source="pack://application:,,,/PDF Office;component/Styles/ContextMenuStyle.xaml" />
  29. <!-- Enable show customctrol's correctly UI in Xaml Designer -->
  30. <ResourceDictionary Source="pack://application:,,,/PDF Office;component/Themes/Generic.xaml" />
  31. </ResourceDictionary.MergedDictionaries>
  32. <Style TargetType="{x:Type Hyperlink}">
  33. <Setter Property="Foreground" Value="#477EDE" />
  34. <Setter Property="TextBlock.TextDecorations" Value="{x:Null}" />
  35. <Style.Triggers>
  36. <Trigger Property="IsMouseOver" Value="True">
  37. <Setter Property="Foreground" Value="#6B97E4" />
  38. <!-- 在鼠标悬停显示下划线 -->
  39. <Setter Property="TextBlock.TextDecorations">
  40. <Setter.Value>
  41. <TextDecorationCollection>
  42. <TextDecoration Location="Underline" />
  43. </TextDecorationCollection>
  44. </Setter.Value>
  45. </Setter>
  46. </Trigger>
  47. </Style.Triggers>
  48. </Style>
  49. <!-- Design Token Menu Without Icon -->
  50. <Style TargetType="{x:Type MenuItem}">
  51. <Setter Property="Foreground" Value="{StaticResource color.sys.text.neutral.lv1}" />
  52. <Setter Property="Background" Value="Transparent" />
  53. <Setter Property="Height" Value="32" />
  54. <Setter Property="Margin" Value="8,0" />
  55. <Setter Property="Template">
  56. <Setter.Value>
  57. <ControlTemplate TargetType="{x:Type MenuItem}">
  58. <Border
  59. x:Name="Border"
  60. Background="{TemplateBinding Background}"
  61. BorderBrush="{TemplateBinding BorderBrush}"
  62. BorderThickness="0"
  63. CornerRadius="7">
  64. <Grid>
  65. <Grid.ColumnDefinitions>
  66. <ColumnDefinition
  67. x:Name="ColIcon"
  68. Width="Auto"
  69. SharedSizeGroup="MenuItemIconColumnGroup" />
  70. <ColumnDefinition Width="Auto" SharedSizeGroup="MenuTextColumnGroup" />
  71. <ColumnDefinition Width="Auto" SharedSizeGroup="MenuItemIGTColumnGroup" />
  72. <ColumnDefinition x:Name="ColNext" Width="auto" />
  73. </Grid.ColumnDefinitions>
  74. <ContentPresenter
  75. x:Name="Icon"
  76. Grid.Column="0"
  77. Margin="5,0"
  78. VerticalAlignment="Center"
  79. ContentSource="Icon" />
  80. <Grid
  81. x:Name="GlyphPanel"
  82. Grid.Column="0"
  83. Margin="5,0"
  84. VerticalAlignment="Center"
  85. Visibility="Collapsed">
  86. <Viewbox
  87. Width="18"
  88. Height="18"
  89. VerticalAlignment="Center"
  90. FlowDirection="LeftToRight">
  91. <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}" />
  92. </Viewbox>
  93. </Grid>
  94. <ContentPresenter
  95. x:Name="HeaderHost"
  96. Grid.Column="1"
  97. Margin="{TemplateBinding Padding}"
  98. VerticalAlignment="Center"
  99. ContentSource="Header"
  100. RecognizesAccessKey="True" />
  101. <ContentPresenter
  102. x:Name="IGTHost"
  103. Grid.Column="2"
  104. Margin="8,0"
  105. VerticalAlignment="Center"
  106. ContentSource="InputGestureText" />
  107. <Grid
  108. x:Name="ArrowPanel"
  109. Grid.Column="3"
  110. Margin="10,0"
  111. HorizontalAlignment="Right"
  112. VerticalAlignment="Center">
  113. <Path
  114. x:Name="ArrowPanelPath"
  115. HorizontalAlignment="Right"
  116. VerticalAlignment="Center"
  117. Data="M0,0 L0,8 L4,4 z"
  118. Fill="{TemplateBinding Foreground}" />
  119. </Grid>
  120. <Popup
  121. x:Name="SubMenuPopup"
  122. AllowsTransparency="True"
  123. Focusable="false"
  124. IsOpen="{Binding Path=IsSubmenuOpen, RelativeSource={RelativeSource TemplatedParent}}"
  125. Placement="Right">
  126. <Border
  127. x:Name="SubMenuBorder"
  128. Padding="2,2,2,2"
  129. Background="{TemplateBinding Background}"
  130. BorderBrush="#999999"
  131. BorderThickness="0"
  132. CornerRadius="7">
  133. <Grid x:Name="SubMenu" Grid.IsSharedSizeScope="True">
  134. <StackPanel IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Cycle" />
  135. </Grid>
  136. </Border>
  137. </Popup>
  138. </Grid>
  139. </Border>
  140. <ControlTemplate.Triggers>
  141. <Trigger Property="Role" Value="TopLevelHeader">
  142. <Setter Property="Padding" Value="6,1" />
  143. <Setter Property="Background" Value="Transparent" />
  144. <Setter TargetName="SubMenuPopup" Property="Placement" Value="Bottom" />
  145. <Setter TargetName="ColIcon" Property="MinWidth" Value="0" />
  146. <Setter TargetName="ColNext" Property="Width" Value="Auto" />
  147. <Setter TargetName="Icon" Property="Visibility" Value="Collapsed" />
  148. <Setter TargetName="GlyphPanel" Property="Visibility" Value="Collapsed" />
  149. <Setter TargetName="IGTHost" Property="Visibility" Value="Collapsed" />
  150. <Setter TargetName="ArrowPanel" Property="Visibility" Value="Collapsed" />
  151. </Trigger>
  152. <Trigger Property="IsHighlighted" Value="true">
  153. <Setter TargetName="Border" Property="Background" Value="{StaticResource color.item-state.sel.bg.lv1}" />
  154. <Setter Property="Foreground" Value="{StaticResource color.sys.text.accent.norm}" />
  155. </Trigger>
  156. <MultiTrigger>
  157. <MultiTrigger.Conditions>
  158. <Condition Property="IsHighlighted" Value="True" />
  159. <Condition Property="Role" Value="TopLevelHeader" />
  160. </MultiTrigger.Conditions>
  161. <MultiTrigger.Setters>
  162. <Setter TargetName="Border" Property="Background" Value="#0cffffff" />
  163. </MultiTrigger.Setters>
  164. </MultiTrigger>
  165. <Trigger Property="Role" Value="TopLevelItem">
  166. <Setter Property="Padding" Value="6,1" />
  167. <Setter TargetName="ArrowPanel" Property="Visibility" Value="Collapsed" />
  168. </Trigger>
  169. <Trigger Property="Role" Value="SubmenuHeader">
  170. <Setter Property="Padding" Value="5,2" />
  171. </Trigger>
  172. <Trigger Property="Role" Value="SubmenuItem">
  173. <Setter Property="Padding" Value="5,2" />
  174. <Setter TargetName="ArrowPanel" Property="Visibility" Value="Collapsed" />
  175. </Trigger>
  176. <Trigger Property="Icon" Value="{x:Null}">
  177. <Setter TargetName="Icon" Property="Visibility" Value="Collapsed" />
  178. </Trigger>
  179. <Trigger Property="IsChecked" Value="true">
  180. <Setter TargetName="GlyphPanel" Property="Visibility" Value="Visible" />
  181. <Setter TargetName="Icon" Property="Visibility" Value="Collapsed" />
  182. </Trigger>
  183. <Trigger Property="IsEnabled" Value="false">
  184. <Setter Property="Foreground" Value="{StaticResource color.sys.text.neutral.dis}" />
  185. </Trigger>
  186. </ControlTemplate.Triggers>
  187. </ControlTemplate>
  188. </Setter.Value>
  189. </Setter>
  190. </Style>
  191. <!-- Design Token ContextMenu -->
  192. <Style TargetType="{x:Type ContextMenu}">
  193. <Setter Property="Template">
  194. <Setter.Value>
  195. <ControlTemplate TargetType="{x:Type ContextMenu}">
  196. <!-- Here is where you change the border thickness to zero on the menu -->
  197. <Border Width="{TemplateBinding Width}" Padding="5">
  198. <Border.Effect>
  199. <DropShadowEffect
  200. BlurRadius="5"
  201. Direction="0"
  202. Opacity="0.16"
  203. ShadowDepth="0"
  204. Color="#000000" />
  205. </Border.Effect>
  206. <Border
  207. x:Name="Border"
  208. Padding="0,5"
  209. CornerRadius="5">
  210. <StackPanel
  211. ClipToBounds="True"
  212. IsItemsHost="True"
  213. KeyboardNavigation.DirectionalNavigation="Cycle"
  214. Orientation="Vertical" />
  215. </Border>
  216. </Border>
  217. <ControlTemplate.Triggers>
  218. <Trigger Property="IsMouseOver" Value="true">
  219. <Setter TargetName="Border" Property="Background" Value="#ffffff" />
  220. </Trigger>
  221. </ControlTemplate.Triggers>
  222. </ControlTemplate>
  223. </Setter.Value>
  224. </Setter>
  225. </Style>
  226. <!-- Design Token CheckBox -->
  227. <Style TargetType="{x:Type CheckBox}">
  228. <Setter Property="FocusVisualStyle" Value="{x:Null}" />
  229. <Setter Property="Background" Value="{StaticResource color.icon.checkbox-radio.norm.bg}" />
  230. <Setter Property="BorderBrush" Value="{StaticResource color.icon.checkbox-radio.norm.border}" />
  231. <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
  232. <Setter Property="BorderThickness" Value="1" />
  233. <Setter Property="FontFamily" Value="Segoe UI" />
  234. <Setter Property="FontSize" Value="14" />
  235. <Setter Property="VerticalContentAlignment" Value="Center" />
  236. <Setter Property="Template">
  237. <Setter.Value>
  238. <ControlTemplate TargetType="{x:Type CheckBox}">
  239. <Grid
  240. x:Name="templateRoot"
  241. Background="Transparent"
  242. SnapsToDevicePixels="True">
  243. <Grid.ColumnDefinitions>
  244. <ColumnDefinition Width="Auto" />
  245. <ColumnDefinition Width="*" />
  246. </Grid.ColumnDefinitions>
  247. <Border
  248. x:Name="checkBoxBorder"
  249. Width="14"
  250. Height="14"
  251. Margin="1"
  252. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  253. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  254. Background="{TemplateBinding Background}"
  255. BorderBrush="{TemplateBinding BorderBrush}"
  256. BorderThickness="{TemplateBinding BorderThickness}"
  257. CornerRadius="2">
  258. <Grid x:Name="markGrid">
  259. <Path
  260. x:Name="optionMark"
  261. Data="M3 7L6.2 10L11 4"
  262. Opacity="0"
  263. Stroke="{StaticResource color.icon.checkbox-radio.norm.bg}"
  264. StrokeLineJoin="Round"
  265. StrokeThickness="1.5">
  266. <Path.RenderTransform>
  267. <TranslateTransform X="-0.5" Y="-1" />
  268. </Path.RenderTransform>
  269. </Path>
  270. <Rectangle
  271. x:Name="indeterminateMark"
  272. Margin="2"
  273. Fill="{StaticResource color.icon.checkbox-radio.norm.border}"
  274. Opacity="0" />
  275. </Grid>
  276. </Border>
  277. <ContentPresenter
  278. x:Name="contentPresenter"
  279. Grid.Column="1"
  280. Margin="{TemplateBinding Padding}"
  281. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  282. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  283. Focusable="False"
  284. RecognizesAccessKey="True"
  285. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  286. </Grid>
  287. <ControlTemplate.Triggers>
  288. <Trigger Property="HasContent" Value="true">
  289. <Setter Property="Padding" Value="4,0,0,0" />
  290. </Trigger>
  291. <Trigger Property="IsMouseOver" Value="true">
  292. <Setter TargetName="checkBoxBorder" Property="Background" Value="{StaticResource color.icon.checkbox-radio.hov.bg}" />
  293. <Setter TargetName="checkBoxBorder" Property="BorderBrush" Value="{StaticResource color.icon.checkbox-radio.hov.border}" />
  294. </Trigger>
  295. <MultiTrigger>
  296. <MultiTrigger.Conditions>
  297. <Condition Property="IsEnabled" Value="false" />
  298. <Condition Property="IsChecked" Value="True" />
  299. </MultiTrigger.Conditions>
  300. <MultiTrigger.Setters>
  301. <Setter TargetName="optionMark" Property="Opacity" Value="1" />
  302. <Setter TargetName="indeterminateMark" Property="Opacity" Value="0" />
  303. <Setter TargetName="checkBoxBorder" Property="Background" Value="{StaticResource color.icon.checkbox-radio.dis.bg}" />
  304. <Setter TargetName="checkBoxBorder" Property="BorderBrush" Value="{StaticResource color.icon.checkbox-radio.dis.border}" />
  305. <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource color.icon.checkbox-radio.dis.fill}" />
  306. <Setter Property="Foreground" Value="{StaticResource color.sys.text.neutral.dis}" />
  307. </MultiTrigger.Setters>
  308. </MultiTrigger>
  309. <MultiTrigger>
  310. <MultiTrigger.Conditions>
  311. <Condition Property="IsEnabled" Value="false" />
  312. <Condition Property="IsChecked" Value="false" />
  313. </MultiTrigger.Conditions>
  314. <MultiTrigger.Setters>
  315. <Setter TargetName="optionMark" Property="Opacity" Value="0" />
  316. <Setter TargetName="indeterminateMark" Property="Opacity" Value="1" />
  317. <Setter TargetName="checkBoxBorder" Property="Background" Value="{StaticResource color.icon.checkbox-radio.dis.bg}" />
  318. <Setter TargetName="checkBoxBorder" Property="BorderBrush" Value="{StaticResource color.icon.checkbox-radio.dis.border}" />
  319. </MultiTrigger.Setters>
  320. </MultiTrigger>
  321. <!--<Trigger Property="IsPressed" Value="true">
  322. <Setter TargetName="checkBoxBorder" Property="Background" Value="{StaticResource OptionMark.Pressed.Background}" />
  323. <Setter TargetName="checkBoxBorder" Property="BorderBrush" Value="{StaticResource OptionMark.Pressed.Border}" />
  324. <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource OptionMark.Pressed.Glyph}" />
  325. <Setter TargetName="indeterminateMark" Property="Fill" Value="{StaticResource OptionMark.Pressed.Glyph}" />
  326. </Trigger>-->
  327. <Trigger Property="IsChecked" Value="true">
  328. <Setter TargetName="optionMark" Property="Opacity" Value="1" />
  329. <Setter TargetName="indeterminateMark" Property="Opacity" Value="0" />
  330. <Setter TargetName="checkBoxBorder" Property="Background" Value="{StaticResource color.icon.checkbox-radio.sel.bg}" />
  331. <Setter TargetName="checkBoxBorder" Property="BorderBrush" Value="{StaticResource color.icon.checkbox-radio.sel.bg}" />
  332. </Trigger>
  333. <Trigger Property="IsChecked" Value="{x:Null}">
  334. <Setter TargetName="optionMark" Property="Opacity" Value="0" />
  335. <Setter TargetName="indeterminateMark" Property="Opacity" Value="1" />
  336. </Trigger>
  337. </ControlTemplate.Triggers>
  338. </ControlTemplate>
  339. </Setter.Value>
  340. </Setter>
  341. </Style>
  342. <!-- Design Token ComboboxItem -->
  343. <Style TargetType="{x:Type ComboBoxItem}">
  344. <Setter Property="Foreground" Value="{StaticResource color.sys.text.neutral.lv1}" />
  345. <Setter Property="BorderThickness" Value="0" />
  346. <Setter Property="Padding" Value="8,0" />
  347. <Setter Property="Template">
  348. <Setter.Value>
  349. <ControlTemplate TargetType="{x:Type ComboBoxItem}">
  350. <Border
  351. Name="Bd"
  352. Padding="{TemplateBinding Control.Padding}"
  353. Background="{TemplateBinding Panel.Background}"
  354. BorderBrush="{TemplateBinding Border.BorderBrush}"
  355. BorderThickness="{TemplateBinding Border.BorderThickness}"
  356. CornerRadius="{StaticResource border-radius.4}"
  357. SnapsToDevicePixels="True">
  358. <ContentPresenter
  359. HorizontalAlignment="{TemplateBinding Control.HorizontalContentAlignment}"
  360. VerticalAlignment="{TemplateBinding Control.VerticalContentAlignment}"
  361. Content="{TemplateBinding ContentControl.Content}"
  362. ContentStringFormat="{TemplateBinding ContentControl.ContentStringFormat}"
  363. ContentTemplate="{TemplateBinding ContentControl.ContentTemplate}"
  364. SnapsToDevicePixels="{TemplateBinding UIElement.SnapsToDevicePixels}" />
  365. </Border>
  366. <ControlTemplate.Triggers>
  367. <Trigger Property="UIElement.IsEnabled" Value="False">
  368. <Setter Property="Foreground" Value="{StaticResource color.sys.text.neutral.dis}" />
  369. </Trigger>
  370. <MultiTrigger>
  371. <MultiTrigger.Conditions>
  372. <Condition Property="Selector.IsSelected" Value="False" />
  373. <Condition Property="UIElement.IsMouseOver" Value="True" />
  374. <Condition Property="UIElement.IsKeyboardFocused" Value="False" />
  375. </MultiTrigger.Conditions>
  376. <Setter TargetName="Bd" Property="Panel.Background" Value="{StaticResource color.item-state.hov.bg}" />
  377. <Setter TargetName="Bd" Property="Border.BorderBrush" Value="#A826A0DA" />
  378. </MultiTrigger>
  379. <MultiTrigger>
  380. <MultiTrigger.Conditions>
  381. <Condition Property="Selector.IsSelected" Value="True" />
  382. <Condition Property="UIElement.IsMouseOver" Value="False" />
  383. <Condition Property="UIElement.IsKeyboardFocused" Value="True" />
  384. </MultiTrigger.Conditions>
  385. <Setter TargetName="Bd" Property="Panel.Background" Value="{StaticResource color.item-state.sel.bg.lv1}" />
  386. <Setter TargetName="Bd" Property="Border.BorderBrush" Value="#26A0DA" />
  387. </MultiTrigger>
  388. <MultiTrigger>
  389. <MultiTrigger.Conditions>
  390. <Condition Property="Selector.IsSelected" Value="True" />
  391. <Condition Property="UIElement.IsMouseOver" Value="True" />
  392. </MultiTrigger.Conditions>
  393. <Setter TargetName="Bd" Property="Panel.Background" Value="{StaticResource color.item-state.hov.bg}" />
  394. <Setter TargetName="Bd" Property="Border.BorderBrush" Value="#1A477EDE" />
  395. </MultiTrigger>
  396. <MultiTrigger>
  397. <MultiTrigger.Conditions>
  398. <Condition Property="Selector.IsSelected" Value="True" />
  399. <Condition Property="UIElement.IsMouseOver" Value="False" />
  400. <Condition Property="UIElement.IsKeyboardFocused" Value="False" />
  401. </MultiTrigger.Conditions>
  402. <Setter TargetName="Bd" Property="Panel.Background" Value="{StaticResource color.item-state.sel.bg.lv1}" />
  403. <Setter TargetName="Bd" Property="Border.BorderBrush" Value="#DADADA" />
  404. </MultiTrigger>
  405. <MultiTrigger>
  406. <MultiTrigger.Conditions>
  407. <Condition Property="Selector.IsSelected" Value="False" />
  408. <Condition Property="UIElement.IsMouseOver" Value="False" />
  409. <Condition Property="UIElement.IsKeyboardFocused" Value="True" />
  410. </MultiTrigger.Conditions>
  411. <Setter TargetName="Bd" Property="Border.BorderBrush" Value="#26A0DA" />
  412. </MultiTrigger>
  413. <MultiTrigger>
  414. <MultiTrigger.Conditions>
  415. <Condition Property="Selector.IsSelected" Value="False" />
  416. <Condition Property="UIElement.IsMouseOver" Value="True" />
  417. <Condition Property="UIElement.IsKeyboardFocused" Value="True" />
  418. </MultiTrigger.Conditions>
  419. <Setter TargetName="Bd" Property="Panel.Background" Value="{StaticResource color.item-state.hov.bg}" />
  420. <Setter TargetName="Bd" Property="Border.BorderBrush" Value="#1A000000" />
  421. </MultiTrigger>
  422. </ControlTemplate.Triggers>
  423. </ControlTemplate>
  424. </Setter.Value>
  425. </Setter>
  426. </Style>
  427. <Style x:Key="ComboBoxToggleButton" TargetType="{x:Type ToggleButton}">
  428. <Setter Property="OverridesDefaultStyle" Value="true" />
  429. <Setter Property="IsTabStop" Value="false" />
  430. <Setter Property="Focusable" Value="false" />
  431. <Setter Property="FocusVisualStyle" Value="{x:Null}" />
  432. <Setter Property="ClickMode" Value="Press" />
  433. <Setter Property="Template">
  434. <Setter.Value>
  435. <ControlTemplate TargetType="{x:Type ToggleButton}">
  436. <Border
  437. x:Name="templateRoot"
  438. Background="{TemplateBinding Background}"
  439. BorderBrush="{StaticResource color.field.border.norm}"
  440. BorderThickness="{TemplateBinding BorderThickness}"
  441. CornerRadius="{StaticResource border-radius.4}"
  442. SnapsToDevicePixels="true">
  443. <Border
  444. x:Name="splitBorder"
  445. Width="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}"
  446. Margin="8,0"
  447. HorizontalAlignment="Right"
  448. BorderBrush="Transparent"
  449. BorderThickness="0"
  450. SnapsToDevicePixels="true">
  451. <Path
  452. x:Name="arrow"
  453. Width="12"
  454. Height="12"
  455. Margin="0"
  456. HorizontalAlignment="Center"
  457. VerticalAlignment="Center"
  458. Data="M6 7.56434L2.03039 3.59473L0.969727 4.65539L5.46967 9.15533C5.76256 9.44822 6.23743 9.44822 6.53033 9.15533L11.0303 4.65539L9.9696 3.59473L6 7.56434Z"
  459. Fill="{StaticResource color.icon.arrow.gray.def}" />
  460. </Border>
  461. </Border>
  462. <ControlTemplate.Triggers>
  463. <MultiDataTrigger>
  464. <MultiDataTrigger.Conditions>
  465. <Condition Binding="{Binding IsEditable, RelativeSource={RelativeSource AncestorType={x:Type ComboBox}}}" Value="true" />
  466. <Condition Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}" Value="false" />
  467. <Condition Binding="{Binding IsPressed, RelativeSource={RelativeSource Self}}" Value="false" />
  468. <Condition Binding="{Binding IsEnabled, RelativeSource={RelativeSource Self}}" Value="true" />
  469. </MultiDataTrigger.Conditions>
  470. <Setter TargetName="templateRoot" Property="BorderBrush" Value="{StaticResource color.field.border.norm}" />
  471. </MultiDataTrigger>
  472. <Trigger Property="IsMouseOver" Value="true">
  473. <Setter TargetName="arrow" Property="Fill" Value="{StaticResource color.icon.arrow.accent.hov}" />
  474. <Setter TargetName="templateRoot" Property="BorderBrush" Value="{StaticResource color.field.border.hov}" />
  475. </Trigger>
  476. <MultiDataTrigger>
  477. <MultiDataTrigger.Conditions>
  478. <Condition Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}" Value="true" />
  479. <Condition Binding="{Binding IsEditable, RelativeSource={RelativeSource AncestorType={x:Type ComboBox}}}" Value="false" />
  480. </MultiDataTrigger.Conditions>
  481. <Setter TargetName="templateRoot" Property="BorderBrush" Value="{StaticResource color.field.border.hov}" />
  482. </MultiDataTrigger>
  483. <MultiDataTrigger>
  484. <MultiDataTrigger.Conditions>
  485. <Condition Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}" Value="true" />
  486. <Condition Binding="{Binding IsEditable, RelativeSource={RelativeSource AncestorType={x:Type ComboBox}}}" Value="true" />
  487. </MultiDataTrigger.Conditions>
  488. <Setter TargetName="templateRoot" Property="BorderBrush" Value="{StaticResource color.field.border.hov}" />
  489. </MultiDataTrigger>
  490. <Trigger Property="IsPressed" Value="true">
  491. <Setter TargetName="arrow" Property="Fill" Value="{StaticResource color.icon.arrow.accent.hov}" />
  492. </Trigger>
  493. <Trigger Property="IsFocused" Value="True">
  494. <Setter TargetName="templateRoot" Property="BorderBrush" Value="{StaticResource color.field.border.focus}" />
  495. <Setter TargetName="templateRoot" Property="Effect" Value="{StaticResource shadow.blue-0-4}" />
  496. </Trigger>
  497. <Trigger Property="IsChecked" Value="True">
  498. <Setter TargetName="arrow" Property="LayoutTransform">
  499. <Setter.Value>
  500. <RotateTransform Angle="180" />
  501. </Setter.Value>
  502. </Setter>
  503. </Trigger>
  504. <Trigger Property="IsEnabled" Value="false">
  505. <Setter TargetName="arrow" Property="Fill" Value="{StaticResource color.icon.arrow.gray.dis}" />
  506. <Setter TargetName="templateRoot" Property="Background" Value="{StaticResource color.field.bg.dis}" />
  507. <Setter TargetName="templateRoot" Property="BorderBrush" Value="{StaticResource color.field.border.dis}" />
  508. </Trigger>
  509. </ControlTemplate.Triggers>
  510. </ControlTemplate>
  511. </Setter.Value>
  512. </Setter>
  513. </Style>
  514. <ControlTemplate x:Key="ComboBoxTemplate" TargetType="{x:Type ComboBox}">
  515. <Grid
  516. x:Name="templateRoot"
  517. Background="Transparent"
  518. SnapsToDevicePixels="true">
  519. <Grid.ColumnDefinitions>
  520. <ColumnDefinition Width="*" />
  521. <ColumnDefinition Width="0" MinWidth="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}" />
  522. </Grid.ColumnDefinitions>
  523. <Popup
  524. x:Name="PART_Popup"
  525. Grid.ColumnSpan="2"
  526. Margin="1"
  527. AllowsTransparency="true"
  528. IsOpen="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
  529. Placement="Bottom"
  530. PopupAnimation="{DynamicResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}">
  531. <Themes:SystemDropShadowChrome
  532. x:Name="shadow"
  533. MinWidth="{Binding ActualWidth, ElementName=templateRoot}"
  534. MaxHeight="{TemplateBinding MaxDropDownHeight}"
  535. Color="Transparent">
  536. <Border
  537. x:Name="dropDownBorder"
  538. Margin="0,4,0,0"
  539. Background="{StaticResource color.sys.layout.anti}"
  540. BorderBrush="{DynamicResource {x:Static SystemColors.WindowFrameBrushKey}}"
  541. BorderThickness="0"
  542. CornerRadius="{StaticResource radius.base.m}"
  543. Effect="{StaticResource shadow.neutral.m}">
  544. <ScrollViewer x:Name="DropDownScrollViewer">
  545. <Grid HorizontalAlignment="Stretch" SnapsToDevicePixels="True">
  546. <!-- 圆角背景 -->
  547. <Border
  548. x:Name="Bd"
  549. HorizontalAlignment="Stretch"
  550. Background="{StaticResource color.sys.layout.anti}"
  551. BorderThickness="1"
  552. CornerRadius="7">
  553. <!-- 面板内容 -->
  554. <StackPanel
  555. Margin="4"
  556. HorizontalAlignment="Stretch"
  557. IsItemsHost="True"
  558. KeyboardNavigation.DirectionalNavigation="Contained" />
  559. </Border>
  560. </Grid>
  561. </ScrollViewer>
  562. </Border>
  563. </Themes:SystemDropShadowChrome>
  564. </Popup>
  565. <ToggleButton
  566. x:Name="toggleButton"
  567. Grid.ColumnSpan="2"
  568. Background="{TemplateBinding Background}"
  569. BorderBrush="{TemplateBinding BorderBrush}"
  570. BorderThickness="{TemplateBinding BorderThickness}"
  571. IsChecked="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
  572. Style="{StaticResource ComboBoxToggleButton}" />
  573. <ContentPresenter
  574. x:Name="contentPresenter"
  575. Margin="{TemplateBinding Padding}"
  576. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  577. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  578. Content="{TemplateBinding SelectionBoxItem}"
  579. ContentStringFormat="{TemplateBinding SelectionBoxItemStringFormat}"
  580. ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}"
  581. ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}"
  582. IsHitTestVisible="false"
  583. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  584. </Grid>
  585. <ControlTemplate.Triggers>
  586. <Trigger SourceName="PART_Popup" Property="HasDropShadow" Value="true">
  587. <Setter TargetName="shadow" Property="Margin" Value="5" />
  588. </Trigger>
  589. <Trigger Property="HasItems" Value="false">
  590. <Setter TargetName="dropDownBorder" Property="Height" Value="95" />
  591. </Trigger>
  592. <MultiTrigger>
  593. <MultiTrigger.Conditions>
  594. <Condition Property="IsGrouping" Value="true" />
  595. <Condition Property="VirtualizingPanel.IsVirtualizingWhenGrouping" Value="false" />
  596. </MultiTrigger.Conditions>
  597. <Setter Property="ScrollViewer.CanContentScroll" Value="false" />
  598. </MultiTrigger>
  599. </ControlTemplate.Triggers>
  600. </ControlTemplate>
  601. <SolidColorBrush x:Key="TextBox.Static.Background" Color="#FFFFFFFF" />
  602. <Style x:Key="ComboBoxEditableTextBox" TargetType="{x:Type TextBox}">
  603. <Setter Property="OverridesDefaultStyle" Value="true" />
  604. <Setter Property="AllowDrop" Value="true" />
  605. <Setter Property="MinWidth" Value="0" />
  606. <Setter Property="MinHeight" Value="0" />
  607. <Setter Property="FocusVisualStyle" Value="{x:Null}" />
  608. <Setter Property="ScrollViewer.PanningMode" Value="VerticalFirst" />
  609. <Setter Property="Stylus.IsFlicksEnabled" Value="False" />
  610. <Setter Property="Template">
  611. <Setter.Value>
  612. <ControlTemplate TargetType="{x:Type TextBox}">
  613. <ScrollViewer
  614. x:Name="PART_ContentHost"
  615. Background="Transparent"
  616. Focusable="false"
  617. HorizontalScrollBarVisibility="Hidden"
  618. VerticalScrollBarVisibility="Hidden" />
  619. </ControlTemplate>
  620. </Setter.Value>
  621. </Setter>
  622. </Style>
  623. <ControlTemplate x:Key="ComboBoxEditableTemplate" TargetType="{x:Type ComboBox}">
  624. <Grid x:Name="templateRoot" SnapsToDevicePixels="true">
  625. <Grid.ColumnDefinitions>
  626. <ColumnDefinition Width="*" />
  627. <ColumnDefinition Width="0" MinWidth="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}" />
  628. </Grid.ColumnDefinitions>
  629. <Popup
  630. x:Name="PART_Popup"
  631. Grid.ColumnSpan="2"
  632. AllowsTransparency="true"
  633. IsOpen="{Binding IsDropDownOpen, RelativeSource={RelativeSource TemplatedParent}}"
  634. Placement="Bottom"
  635. PopupAnimation="{DynamicResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}">
  636. <Themes:SystemDropShadowChrome
  637. x:Name="shadow"
  638. MinWidth="{Binding ActualWidth, ElementName=templateRoot}"
  639. MaxHeight="{TemplateBinding MaxDropDownHeight}"
  640. Color="Transparent">
  641. <Border
  642. x:Name="dropDownBorder"
  643. Background="{DynamicResource {x:Static SystemColors.WindowBrushKey}}"
  644. BorderBrush="{DynamicResource {x:Static SystemColors.WindowFrameBrushKey}}"
  645. BorderThickness="1">
  646. <ScrollViewer x:Name="DropDownScrollViewer">
  647. <Grid x:Name="grid" RenderOptions.ClearTypeHint="Enabled">
  648. <Canvas
  649. x:Name="canvas"
  650. Width="0"
  651. Height="0"
  652. HorizontalAlignment="Left"
  653. VerticalAlignment="Top">
  654. <Rectangle
  655. x:Name="opaqueRect"
  656. Width="{Binding ActualWidth, ElementName=dropDownBorder}"
  657. Height="{Binding ActualHeight, ElementName=dropDownBorder}"
  658. Fill="{Binding Background, ElementName=dropDownBorder}" />
  659. </Canvas>
  660. <ItemsPresenter
  661. x:Name="ItemsPresenter"
  662. KeyboardNavigation.DirectionalNavigation="Contained"
  663. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  664. </Grid>
  665. </ScrollViewer>
  666. </Border>
  667. </Themes:SystemDropShadowChrome>
  668. </Popup>
  669. <ToggleButton
  670. x:Name="toggleButton"
  671. Grid.ColumnSpan="2"
  672. Background="{TemplateBinding Background}"
  673. BorderBrush="{TemplateBinding BorderBrush}"
  674. BorderThickness="{TemplateBinding BorderThickness}"
  675. IsChecked="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
  676. Style="{StaticResource ComboBoxToggleButton}" />
  677. <Border
  678. x:Name="border"
  679. Margin="{TemplateBinding BorderThickness}"
  680. Background="{StaticResource TextBox.Static.Background}">
  681. <TextBox
  682. x:Name="PART_EditableTextBox"
  683. Margin="{TemplateBinding Padding}"
  684. HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
  685. VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
  686. IsReadOnly="{Binding IsReadOnly, RelativeSource={RelativeSource TemplatedParent}}"
  687. Style="{StaticResource ComboBoxEditableTextBox}" />
  688. </Border>
  689. </Grid>
  690. <ControlTemplate.Triggers>
  691. <Trigger Property="IsEnabled" Value="false">
  692. <Setter TargetName="border" Property="Opacity" Value="0.56" />
  693. </Trigger>
  694. <Trigger Property="IsKeyboardFocusWithin" Value="true">
  695. <Setter Property="Foreground" Value="Black" />
  696. </Trigger>
  697. <Trigger SourceName="PART_Popup" Property="HasDropShadow" Value="true">
  698. <Setter TargetName="shadow" Property="Margin" Value="0,0,5,5" />
  699. <Setter TargetName="shadow" Property="Color" Value="#71000000" />
  700. </Trigger>
  701. <Trigger Property="HasItems" Value="false">
  702. <Setter TargetName="dropDownBorder" Property="Height" Value="95" />
  703. </Trigger>
  704. <MultiTrigger>
  705. <MultiTrigger.Conditions>
  706. <Condition Property="IsGrouping" Value="true" />
  707. <Condition Property="VirtualizingPanel.IsVirtualizingWhenGrouping" Value="false" />
  708. </MultiTrigger.Conditions>
  709. <Setter Property="ScrollViewer.CanContentScroll" Value="false" />
  710. </MultiTrigger>
  711. <Trigger SourceName="DropDownScrollViewer" Property="ScrollViewer.CanContentScroll" Value="false">
  712. <Setter TargetName="opaqueRect" Property="Canvas.Top" Value="{Binding VerticalOffset, ElementName=DropDownScrollViewer}" />
  713. <Setter TargetName="opaqueRect" Property="Canvas.Left" Value="{Binding HorizontalOffset, ElementName=DropDownScrollViewer}" />
  714. </Trigger>
  715. </ControlTemplate.Triggers>
  716. </ControlTemplate>
  717. <!-- Design Token ComBobox -->
  718. <Style TargetType="{x:Type ComboBox}">
  719. <Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual}" />
  720. <Setter Property="Background" Value="{StaticResource color.field.bg.def}" />
  721. <Setter Property="BorderBrush" Value="{StaticResource color.field.border.norm}" />
  722. <Setter Property="Foreground" Value="{StaticResource color.field.text.act}" />
  723. <Setter Property="BorderThickness" Value="{StaticResource border-width.1}" />
  724. <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto" />
  725. <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" />
  726. <Setter Property="VerticalContentAlignment" Value="Center" />
  727. <Setter Property="Padding" Value="8,3,5,3" />
  728. <Setter Property="ScrollViewer.CanContentScroll" Value="true" />
  729. <Setter Property="ScrollViewer.PanningMode" Value="Both" />
  730. <Setter Property="Stylus.IsFlicksEnabled" Value="False" />
  731. <Setter Property="Template" Value="{StaticResource ComboBoxTemplate}" />
  732. <Style.Triggers>
  733. <Trigger Property="IsEditable" Value="true">
  734. <Setter Property="IsTabStop" Value="false" />
  735. <Setter Property="Padding" Value="2" />
  736. <Setter Property="Template" Value="{StaticResource ComboBoxEditableTemplate}" />
  737. </Trigger>
  738. </Style.Triggers>
  739. </Style>
  740. <!-- Design Token RadionButton -->
  741. <Style TargetType="{x:Type RadioButton}">
  742. <Setter Property="FocusVisualStyle" Value="{x:Null}" />
  743. <Setter Property="Background" Value="{StaticResource color.icon.checkbox-radio.norm.bg}" />
  744. <Setter Property="BorderBrush" Value="{StaticResource color.icon.checkbox-radio.norm.border}" />
  745. <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
  746. <Setter Property="BorderThickness" Value="1" />
  747. <Setter Property="Padding" Value="8,0,0,0" />
  748. <Setter Property="Template">
  749. <Setter.Value>
  750. <ControlTemplate TargetType="{x:Type RadioButton}">
  751. <Grid
  752. x:Name="templateRoot"
  753. Background="Transparent"
  754. SnapsToDevicePixels="True">
  755. <Grid.ColumnDefinitions>
  756. <ColumnDefinition Width="Auto" />
  757. <ColumnDefinition Width="*" />
  758. </Grid.ColumnDefinitions>
  759. <Border
  760. x:Name="radioButtonBorder"
  761. Width="14"
  762. Height="14"
  763. HorizontalAlignment="Center"
  764. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  765. Background="{TemplateBinding Background}"
  766. BorderBrush="{TemplateBinding BorderBrush}"
  767. BorderThickness="{TemplateBinding BorderThickness}"
  768. CornerRadius="100">
  769. <Grid x:Name="markGrid" Margin="1.8">
  770. <Ellipse
  771. x:Name="optionMark"
  772. MinWidth="6"
  773. MinHeight="6"
  774. Fill="{StaticResource color.icon.checkbox-radio.sel.bg}"
  775. Opacity="0" />
  776. </Grid>
  777. </Border>
  778. <ContentPresenter
  779. x:Name="contentPresenter"
  780. Grid.Column="1"
  781. Margin="{TemplateBinding Padding}"
  782. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  783. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  784. Focusable="False"
  785. RecognizesAccessKey="True"
  786. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  787. </Grid>
  788. <ControlTemplate.Triggers>
  789. <!--<Trigger Property="HasContent" Value="true">
  790. <Setter Property="Padding" Value="4,-1,0,0" />
  791. </Trigger>-->
  792. <Trigger Property="IsMouseOver" Value="true">
  793. <Setter TargetName="radioButtonBorder" Property="BorderBrush" Value="{StaticResource color.icon.checkbox-radio.hov.border}" />
  794. </Trigger>
  795. <Trigger Property="IsEnabled" Value="false">
  796. <Setter TargetName="radioButtonBorder" Property="Background" Value="{StaticResource color.icon.checkbox-radio.dis.bg}" />
  797. <Setter TargetName="radioButtonBorder" Property="BorderBrush" Value="{StaticResource color.icon.checkbox-radio.dis.border}" />
  798. <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource color.icon.checkbox-radio.dis.fill}" />
  799. </Trigger>
  800. <!--<Trigger Property="IsPressed" Value="true">
  801. <Setter Property="Background" TargetName="radioButtonBorder" Value="{StaticResource RadioButton.Pressed.Background2}"/>
  802. <Setter Property="BorderBrush" TargetName="radioButtonBorder" Value="{StaticResource RadioButton.Pressed.Border}"/>
  803. <Setter Property="Fill" TargetName="optionMark" Value="{StaticResource RadioButton.Pressed.Glyph2}"/>
  804. </Trigger>-->
  805. <Trigger Property="IsChecked" Value="true">
  806. <Setter TargetName="optionMark" Property="Opacity" Value="1" />
  807. <Setter TargetName="radioButtonBorder" Property="BorderBrush" Value="{StaticResource color.icon.checkbox-radio.hov.border}" />
  808. </Trigger>
  809. <Trigger Property="IsChecked" Value="{x:Null}">
  810. <Setter TargetName="optionMark" Property="Opacity" Value="0.56" />
  811. </Trigger>
  812. </ControlTemplate.Triggers>
  813. </ControlTemplate>
  814. </Setter.Value>
  815. </Setter>
  816. </Style>
  817. </ResourceDictionary>
  818. </Application.Resources>
  819. </prism:PrismApplication>