App.xaml 24 KB

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