App.xaml 58 KB

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