App.xaml 57 KB

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