App.xaml 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348
  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:local="clr-namespace:PDF_Office"
  6. xmlns:prism="http://prismlibrary.com/"
  7. xmlns:sys="clr-namespace:System;assembly=mscorlib">
  8. <Application.Resources>
  9. <ResourceDictionary>
  10. <ResourceDictionary.MergedDictionaries>
  11. <ResourceDictionary Source="pack://application:,,,/PDF Office;component/Themes/Alias_Light.xaml" />
  12. <ResourceDictionary Source="pack://application:,,,/PDF Office;component/Themes/Global.xaml" />
  13. <ResourceDictionary Source="pack://application:,,,/PDF Office;component/Styles/TabControlStyle.xaml" />
  14. <ResourceDictionary Source="pack://application:,,,/PDF Office;component/Styles/ButtonStyle.xaml" />
  15. <ResourceDictionary Source="pack://application:,,,/PDF Office;component/Styles/ToggleButton.xaml" />
  16. <ResourceDictionary Source="pack://application:,,,/PDF Office;component/Styles/TextBoxStyle.xaml" />
  17. <ResourceDictionary Source="pack://application:,,,/PDF Office;component/Styles/ComboxStyle.xaml" />
  18. <ResourceDictionary Source="pack://application:,,,/PDF Office;component/Styles/ListBoxStyle.xaml" />
  19. <ResourceDictionary Source="pack://application:,,,/PDF Office;component/Styles/WindowsStyle.xaml" />
  20. <ResourceDictionary Source="pack://application:,,,/PDF Office;component/Styles/CustomBtnStyle.xaml" />
  21. <ResourceDictionary Source="pack://application:,,,/PDF Office;component/Styles/ContainerStyles/ComboxStyle/ComboxItemStyle.xaml" />
  22. <ResourceDictionary Source="pack://application:,,,/PDF Office;component/Styles/PathButtonStyle.xaml" />
  23. <ResourceDictionary Source="pack://application:,,,/PDF Office;component/Styles/ContextMenuTextEditStyle.xaml" />
  24. <ResourceDictionary Source="pack://application:,,,/PDF Office;component/Styles/ContextMenuStyle.xaml" />
  25. <!-- Enable show customctrol's correctly UI in Xaml Designer -->
  26. <ResourceDictionary Source="pack://application:,,,/PDF Office;component/Themes/Generic.xaml" />
  27. </ResourceDictionary.MergedDictionaries>
  28. <Style TargetType="{x:Type Hyperlink}">
  29. <Setter Property="Foreground" Value="#477EDE" />
  30. <Setter Property="TextBlock.TextDecorations" Value="{x:Null}" />
  31. <Style.Triggers>
  32. <Trigger Property="IsMouseOver" Value="True">
  33. <Setter Property="Foreground" Value="#6B97E4" />
  34. <!-- 在鼠标悬停显示下划线 -->
  35. <Setter Property="TextBlock.TextDecorations">
  36. <Setter.Value>
  37. <TextDecorationCollection>
  38. <TextDecoration Location="Underline" />
  39. </TextDecorationCollection>
  40. </Setter.Value>
  41. </Setter>
  42. </Trigger>
  43. </Style.Triggers>
  44. </Style>
  45. <!-- Design Token Menu Without Icon -->
  46. <Style TargetType="{x:Type MenuItem}">
  47. <Setter Property="Foreground" Value="{StaticResource color.sys.text.neutral.lv1}" />
  48. <Setter Property="Background" Value="Transparent" />
  49. <Setter Property="Height" Value="32" />
  50. <Setter Property="Margin" Value="8,0" />
  51. <Setter Property="Template">
  52. <Setter.Value>
  53. <ControlTemplate TargetType="{x:Type MenuItem}">
  54. <Border
  55. x:Name="Border"
  56. Background="{TemplateBinding Background}"
  57. BorderBrush="{TemplateBinding BorderBrush}"
  58. BorderThickness="0"
  59. CornerRadius="7">
  60. <Grid>
  61. <Grid.ColumnDefinitions>
  62. <ColumnDefinition
  63. x:Name="ColIcon"
  64. Width="Auto"
  65. SharedSizeGroup="MenuItemIconColumnGroup" />
  66. <ColumnDefinition Width="Auto" SharedSizeGroup="MenuTextColumnGroup" />
  67. <ColumnDefinition Width="Auto" SharedSizeGroup="MenuItemIGTColumnGroup" />
  68. <ColumnDefinition x:Name="ColNext" Width="auto" />
  69. </Grid.ColumnDefinitions>
  70. <ContentPresenter
  71. x:Name="Icon"
  72. Grid.Column="0"
  73. Margin="5,0"
  74. VerticalAlignment="Center"
  75. ContentSource="Icon" />
  76. <Grid
  77. x:Name="GlyphPanel"
  78. Grid.Column="0"
  79. Margin="5,0"
  80. VerticalAlignment="Center"
  81. Visibility="Collapsed">
  82. <Viewbox
  83. Width="18"
  84. Height="18"
  85. VerticalAlignment="Center"
  86. FlowDirection="LeftToRight">
  87. <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}" />
  88. </Viewbox>
  89. </Grid>
  90. <ContentPresenter
  91. x:Name="HeaderHost"
  92. Grid.Column="1"
  93. Margin="{TemplateBinding Padding}"
  94. VerticalAlignment="Center"
  95. ContentSource="Header"
  96. RecognizesAccessKey="True" />
  97. <ContentPresenter
  98. x:Name="IGTHost"
  99. Grid.Column="2"
  100. Margin="8,0"
  101. VerticalAlignment="Center"
  102. ContentSource="InputGestureText" />
  103. <Grid
  104. x:Name="ArrowPanel"
  105. Grid.Column="3"
  106. Margin="10,0"
  107. HorizontalAlignment="Right"
  108. VerticalAlignment="Center">
  109. <Path
  110. x:Name="ArrowPanelPath"
  111. HorizontalAlignment="Right"
  112. VerticalAlignment="Center"
  113. Data="M0,0 L0,8 L4,4 z"
  114. Fill="{TemplateBinding Foreground}" />
  115. </Grid>
  116. <Popup
  117. x:Name="SubMenuPopup"
  118. AllowsTransparency="True"
  119. Focusable="false"
  120. IsOpen="{Binding Path=IsSubmenuOpen, RelativeSource={RelativeSource TemplatedParent}}"
  121. Placement="Right">
  122. <Border
  123. x:Name="SubMenuBorder"
  124. Padding="2,2,2,2"
  125. Background="#1D1D1D"
  126. BorderBrush="#999999"
  127. BorderThickness="0"
  128. CornerRadius="7">
  129. <Grid x:Name="SubMenu" Grid.IsSharedSizeScope="True">
  130. <StackPanel IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Cycle" />
  131. </Grid>
  132. </Border>
  133. </Popup>
  134. </Grid>
  135. </Border>
  136. <ControlTemplate.Triggers>
  137. <Trigger Property="Role" Value="TopLevelHeader">
  138. <Setter Property="Padding" Value="6,1" />
  139. <Setter Property="Background" Value="Transparent" />
  140. <Setter TargetName="SubMenuPopup" Property="Placement" Value="Bottom" />
  141. <Setter TargetName="ColIcon" Property="MinWidth" Value="0" />
  142. <Setter TargetName="ColNext" Property="Width" Value="Auto" />
  143. <Setter TargetName="Icon" Property="Visibility" Value="Collapsed" />
  144. <Setter TargetName="GlyphPanel" Property="Visibility" Value="Collapsed" />
  145. <Setter TargetName="IGTHost" Property="Visibility" Value="Collapsed" />
  146. <Setter TargetName="ArrowPanel" Property="Visibility" Value="Collapsed" />
  147. </Trigger>
  148. <Trigger Property="IsHighlighted" Value="true">
  149. <Setter TargetName="Border" Property="Background" Value="{StaticResource color.item-state.sel.bg.lv1}" />
  150. <Setter Property="Foreground" Value="{StaticResource color.sys.text.accent.norm}" />
  151. </Trigger>
  152. <MultiTrigger>
  153. <MultiTrigger.Conditions>
  154. <Condition Property="IsHighlighted" Value="True" />
  155. <Condition Property="Role" Value="TopLevelHeader" />
  156. </MultiTrigger.Conditions>
  157. <MultiTrigger.Setters>
  158. <Setter TargetName="Border" Property="Background" Value="#0cffffff" />
  159. </MultiTrigger.Setters>
  160. </MultiTrigger>
  161. <Trigger Property="Role" Value="TopLevelItem">
  162. <Setter Property="Padding" Value="6,1" />
  163. <Setter TargetName="ArrowPanel" Property="Visibility" Value="Collapsed" />
  164. </Trigger>
  165. <Trigger Property="Role" Value="SubmenuHeader">
  166. <Setter Property="Padding" Value="5,2" />
  167. </Trigger>
  168. <Trigger Property="Role" Value="SubmenuItem">
  169. <Setter Property="Padding" Value="5,2" />
  170. <Setter TargetName="ArrowPanel" Property="Visibility" Value="Collapsed" />
  171. </Trigger>
  172. <Trigger Property="Icon" Value="{x:Null}">
  173. <Setter TargetName="Icon" Property="Visibility" Value="Collapsed" />
  174. </Trigger>
  175. <Trigger Property="IsChecked" Value="true">
  176. <Setter TargetName="GlyphPanel" Property="Visibility" Value="Visible" />
  177. <Setter TargetName="Icon" Property="Visibility" Value="Collapsed" />
  178. </Trigger>
  179. <Trigger Property="IsEnabled" Value="false">
  180. <Setter Property="Foreground" Value="{StaticResource color.sys.text.neutral.dis}" />
  181. </Trigger>
  182. </ControlTemplate.Triggers>
  183. </ControlTemplate>
  184. </Setter.Value>
  185. </Setter>
  186. </Style>
  187. <!-- Design Token ContextMenu -->
  188. <Style TargetType="{x:Type ContextMenu}">
  189. <Setter Property="Template">
  190. <Setter.Value>
  191. <ControlTemplate TargetType="{x:Type ContextMenu}">
  192. <!-- Here is where you change the border thickness to zero on the menu -->
  193. <Border Width="{TemplateBinding Width}" Padding="5">
  194. <Border.Effect>
  195. <DropShadowEffect
  196. BlurRadius="5"
  197. Direction="0"
  198. Opacity="0.16"
  199. ShadowDepth="0"
  200. Color="#000000" />
  201. </Border.Effect>
  202. <Border
  203. x:Name="Border"
  204. Padding="0,5"
  205. CornerRadius="5">
  206. <StackPanel
  207. ClipToBounds="True"
  208. IsItemsHost="True"
  209. KeyboardNavigation.DirectionalNavigation="Cycle"
  210. Orientation="Vertical" />
  211. </Border>
  212. </Border>
  213. <ControlTemplate.Triggers>
  214. <Trigger Property="IsMouseOver" Value="true">
  215. <Setter TargetName="Border" Property="Background" Value="#ffffff" />
  216. </Trigger>
  217. </ControlTemplate.Triggers>
  218. </ControlTemplate>
  219. </Setter.Value>
  220. </Setter>
  221. </Style>
  222. <!-- Design Token CheckBox -->
  223. <Style TargetType="{x:Type CheckBox}">
  224. <Setter Property="FocusVisualStyle" Value="{x:Null}" />
  225. <Setter Property="Background" Value="{StaticResource color.icon.checkbox-radio.norm.bg}" />
  226. <Setter Property="BorderBrush" Value="{StaticResource color.icon.checkbox-radio.norm.border}" />
  227. <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
  228. <Setter Property="BorderThickness" Value="1" />
  229. <Setter Property="FontFamily" Value="Segoe UI" />
  230. <Setter Property="FontSize" Value="14" />
  231. <Setter Property="VerticalContentAlignment" Value="Center" />
  232. <Setter Property="Template">
  233. <Setter.Value>
  234. <ControlTemplate TargetType="{x:Type CheckBox}">
  235. <Grid
  236. x:Name="templateRoot"
  237. Background="Transparent"
  238. SnapsToDevicePixels="True">
  239. <Grid.ColumnDefinitions>
  240. <ColumnDefinition Width="Auto" />
  241. <ColumnDefinition Width="*" />
  242. </Grid.ColumnDefinitions>
  243. <Border
  244. x:Name="checkBoxBorder"
  245. Width="14"
  246. Height="14"
  247. Margin="1"
  248. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  249. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  250. Background="{TemplateBinding Background}"
  251. BorderBrush="{TemplateBinding BorderBrush}"
  252. BorderThickness="{TemplateBinding BorderThickness}"
  253. CornerRadius="2">
  254. <Grid x:Name="markGrid">
  255. <Path
  256. x:Name="optionMark"
  257. Data="M3 7L6.2 10L11 4"
  258. Opacity="0"
  259. Stroke="{StaticResource color.icon.checkbox-radio.norm.bg}"
  260. StrokeLineJoin="Round"
  261. StrokeThickness="1.5">
  262. <Path.RenderTransform>
  263. <TranslateTransform X="-0.5" Y="-1" />
  264. </Path.RenderTransform>
  265. </Path>
  266. <Rectangle
  267. x:Name="indeterminateMark"
  268. Margin="2"
  269. Fill="{StaticResource color.icon.checkbox-radio.norm.border}"
  270. Opacity="0" />
  271. </Grid>
  272. </Border>
  273. <ContentPresenter
  274. x:Name="contentPresenter"
  275. Grid.Column="1"
  276. Margin="{TemplateBinding Padding}"
  277. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  278. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  279. Focusable="False"
  280. RecognizesAccessKey="True"
  281. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  282. </Grid>
  283. <ControlTemplate.Triggers>
  284. <Trigger Property="HasContent" Value="true">
  285. <Setter Property="Padding" Value="4,0,0,0" />
  286. </Trigger>
  287. <Trigger Property="IsMouseOver" Value="true">
  288. <Setter TargetName="checkBoxBorder" Property="Background" Value="{StaticResource color.icon.checkbox-radio.hov.bg}" />
  289. <Setter TargetName="checkBoxBorder" Property="BorderBrush" Value="{StaticResource color.icon.checkbox-radio.hov.border}" />
  290. </Trigger>
  291. <MultiTrigger>
  292. <MultiTrigger.Conditions>
  293. <Condition Property="IsEnabled" Value="false" />
  294. <Condition Property="IsChecked" Value="True" />
  295. </MultiTrigger.Conditions>
  296. <MultiTrigger.Setters>
  297. <Setter TargetName="optionMark" Property="Opacity" Value="1" />
  298. <Setter TargetName="indeterminateMark" Property="Opacity" Value="0" />
  299. <Setter TargetName="checkBoxBorder" Property="Background" Value="{StaticResource color.icon.checkbox-radio.dis.bg}" />
  300. <Setter TargetName="checkBoxBorder" Property="BorderBrush" Value="{StaticResource color.icon.checkbox-radio.dis.border}" />
  301. <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource color.icon.checkbox-radio.dis.fill}" />
  302. <Setter Property="Foreground" Value="{StaticResource color.sys.text.neutral.dis}" />
  303. </MultiTrigger.Setters>
  304. </MultiTrigger>
  305. <MultiTrigger>
  306. <MultiTrigger.Conditions>
  307. <Condition Property="IsEnabled" Value="false" />
  308. <Condition Property="IsChecked" Value="false" />
  309. </MultiTrigger.Conditions>
  310. <MultiTrigger.Setters>
  311. <Setter TargetName="optionMark" Property="Opacity" Value="0" />
  312. <Setter TargetName="indeterminateMark" Property="Opacity" Value="1" />
  313. <Setter TargetName="checkBoxBorder" Property="Background" Value="{StaticResource color.icon.checkbox-radio.dis.bg}" />
  314. <Setter TargetName="checkBoxBorder" Property="BorderBrush" Value="{StaticResource color.icon.checkbox-radio.dis.border}" />
  315. </MultiTrigger.Setters>
  316. </MultiTrigger>
  317. <!--<Trigger Property="IsPressed" Value="true">
  318. <Setter TargetName="checkBoxBorder" Property="Background" Value="{StaticResource OptionMark.Pressed.Background}" />
  319. <Setter TargetName="checkBoxBorder" Property="BorderBrush" Value="{StaticResource OptionMark.Pressed.Border}" />
  320. <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource OptionMark.Pressed.Glyph}" />
  321. <Setter TargetName="indeterminateMark" Property="Fill" Value="{StaticResource OptionMark.Pressed.Glyph}" />
  322. </Trigger>-->
  323. <Trigger Property="IsChecked" Value="true">
  324. <Setter TargetName="optionMark" Property="Opacity" Value="1" />
  325. <Setter TargetName="indeterminateMark" Property="Opacity" Value="0" />
  326. <Setter TargetName="checkBoxBorder" Property="Background" Value="{StaticResource color.icon.checkbox-radio.sel.bg}" />
  327. <Setter TargetName="checkBoxBorder" Property="BorderBrush" Value="{StaticResource color.icon.checkbox-radio.sel.bg}" />
  328. </Trigger>
  329. <Trigger Property="IsChecked" Value="{x:Null}">
  330. <Setter TargetName="optionMark" Property="Opacity" Value="0" />
  331. <Setter TargetName="indeterminateMark" Property="Opacity" Value="1" />
  332. </Trigger>
  333. </ControlTemplate.Triggers>
  334. </ControlTemplate>
  335. </Setter.Value>
  336. </Setter>
  337. </Style>
  338. </ResourceDictionary>
  339. </Application.Resources>
  340. </prism:PrismApplication>