App.xaml 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  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. <Style TargetType="{x:Type MenuItem}">
  44. <Setter Property="Foreground" Value="{StaticResource color.sys.text.neutral.lv1}" />
  45. <Setter Property="Background" Value="Transparent" />
  46. <Setter Property="Height" Value="32" />
  47. <Setter Property="Margin" Value="8,0" />
  48. <Setter Property="Template">
  49. <Setter.Value>
  50. <ControlTemplate TargetType="{x:Type MenuItem}">
  51. <Border
  52. x:Name="Border"
  53. Background="{TemplateBinding Background}"
  54. BorderBrush="{TemplateBinding BorderBrush}"
  55. BorderThickness="0"
  56. CornerRadius="7">
  57. <Grid>
  58. <Grid.ColumnDefinitions>
  59. <ColumnDefinition
  60. x:Name="ColIcon"
  61. Width="Auto"
  62. SharedSizeGroup="MenuItemIconColumnGroup" />
  63. <ColumnDefinition Width="Auto" SharedSizeGroup="MenuTextColumnGroup" />
  64. <ColumnDefinition Width="Auto" SharedSizeGroup="MenuItemIGTColumnGroup" />
  65. <ColumnDefinition x:Name="ColNext" Width="auto" />
  66. </Grid.ColumnDefinitions>
  67. <ContentPresenter
  68. x:Name="Icon"
  69. Grid.Column="0"
  70. Margin="5,0"
  71. VerticalAlignment="Center"
  72. ContentSource="Icon" />
  73. <Grid
  74. x:Name="GlyphPanel"
  75. Grid.Column="0"
  76. Margin="5,0"
  77. VerticalAlignment="Center"
  78. Visibility="Collapsed">
  79. <Viewbox
  80. Width="18"
  81. Height="18"
  82. VerticalAlignment="Center"
  83. FlowDirection="LeftToRight">
  84. <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}" />
  85. </Viewbox>
  86. </Grid>
  87. <ContentPresenter
  88. x:Name="HeaderHost"
  89. Grid.Column="1"
  90. Margin="{TemplateBinding Padding}"
  91. VerticalAlignment="Center"
  92. ContentSource="Header"
  93. RecognizesAccessKey="True" />
  94. <ContentPresenter
  95. x:Name="IGTHost"
  96. Grid.Column="2"
  97. Margin="8,0"
  98. VerticalAlignment="Center"
  99. ContentSource="InputGestureText" />
  100. <Grid
  101. x:Name="ArrowPanel"
  102. Grid.Column="3"
  103. Margin="10,0"
  104. HorizontalAlignment="Right"
  105. VerticalAlignment="Center">
  106. <Path
  107. x:Name="ArrowPanelPath"
  108. HorizontalAlignment="Right"
  109. VerticalAlignment="Center"
  110. Data="M0,0 L0,8 L4,4 z"
  111. Fill="{TemplateBinding Foreground}" />
  112. </Grid>
  113. <Popup
  114. x:Name="SubMenuPopup"
  115. AllowsTransparency="True"
  116. Focusable="false"
  117. IsOpen="{Binding Path=IsSubmenuOpen, RelativeSource={RelativeSource TemplatedParent}}"
  118. Placement="Right">
  119. <Border
  120. x:Name="SubMenuBorder"
  121. Padding="2,2,2,2"
  122. Background="#1D1D1D"
  123. BorderBrush="#999999"
  124. BorderThickness="0"
  125. CornerRadius="7">
  126. <Grid x:Name="SubMenu" Grid.IsSharedSizeScope="True">
  127. <StackPanel IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Cycle" />
  128. </Grid>
  129. </Border>
  130. </Popup>
  131. </Grid>
  132. </Border>
  133. <ControlTemplate.Triggers>
  134. <Trigger Property="Role" Value="TopLevelHeader">
  135. <Setter Property="Padding" Value="6,1" />
  136. <Setter Property="Background" Value="Transparent" />
  137. <Setter TargetName="SubMenuPopup" Property="Placement" Value="Bottom" />
  138. <Setter TargetName="ColIcon" Property="MinWidth" Value="0" />
  139. <Setter TargetName="ColNext" Property="Width" Value="Auto" />
  140. <Setter TargetName="Icon" Property="Visibility" Value="Collapsed" />
  141. <Setter TargetName="GlyphPanel" Property="Visibility" Value="Collapsed" />
  142. <Setter TargetName="IGTHost" Property="Visibility" Value="Collapsed" />
  143. <Setter TargetName="ArrowPanel" Property="Visibility" Value="Collapsed" />
  144. </Trigger>
  145. <Trigger Property="IsHighlighted" Value="true">
  146. <Setter TargetName="Border" Property="Background" Value="{StaticResource color.item-state.sel.bg.lv1}" />
  147. <Setter Property="Foreground" Value="{StaticResource color.sys.text.accent.norm}" />
  148. </Trigger>
  149. <MultiTrigger>
  150. <MultiTrigger.Conditions>
  151. <Condition Property="IsHighlighted" Value="True" />
  152. <Condition Property="Role" Value="TopLevelHeader" />
  153. </MultiTrigger.Conditions>
  154. <MultiTrigger.Setters>
  155. <Setter TargetName="Border" Property="Background" Value="#0cffffff" />
  156. </MultiTrigger.Setters>
  157. </MultiTrigger>
  158. <Trigger Property="Role" Value="TopLevelItem">
  159. <Setter Property="Padding" Value="6,1" />
  160. <Setter TargetName="ArrowPanel" Property="Visibility" Value="Collapsed" />
  161. </Trigger>
  162. <Trigger Property="Role" Value="SubmenuHeader">
  163. <Setter Property="Padding" Value="5,2" />
  164. </Trigger>
  165. <Trigger Property="Role" Value="SubmenuItem">
  166. <Setter Property="Padding" Value="5,2" />
  167. <Setter TargetName="ArrowPanel" Property="Visibility" Value="Collapsed" />
  168. </Trigger>
  169. <Trigger Property="Icon" Value="{x:Null}">
  170. <Setter TargetName="Icon" Property="Visibility" Value="Collapsed" />
  171. </Trigger>
  172. <Trigger Property="IsChecked" Value="true">
  173. <Setter TargetName="GlyphPanel" Property="Visibility" Value="Visible" />
  174. <Setter TargetName="Icon" Property="Visibility" Value="Collapsed" />
  175. </Trigger>
  176. <Trigger Property="IsEnabled" Value="false">
  177. <Setter Property="Foreground" Value="{StaticResource color.sys.text.neutral.dis}" />
  178. </Trigger>
  179. </ControlTemplate.Triggers>
  180. </ControlTemplate>
  181. </Setter.Value>
  182. </Setter>
  183. </Style>
  184. <!-- Outer menu -->
  185. <Style TargetType="{x:Type ContextMenu}">
  186. <Setter Property="Template">
  187. <Setter.Value>
  188. <ControlTemplate TargetType="{x:Type ContextMenu}">
  189. <!-- Here is where you change the border thickness to zero on the menu -->
  190. <Border Width="{TemplateBinding Width}" Padding="5">
  191. <Border.Effect>
  192. <DropShadowEffect
  193. BlurRadius="5"
  194. Direction="0"
  195. Opacity="0.16"
  196. ShadowDepth="0"
  197. Color="#000000" />
  198. </Border.Effect>
  199. <Border
  200. x:Name="Border"
  201. Padding="0,5"
  202. CornerRadius="5">
  203. <StackPanel
  204. ClipToBounds="True"
  205. IsItemsHost="True"
  206. KeyboardNavigation.DirectionalNavigation="Cycle"
  207. Orientation="Vertical" />
  208. </Border>
  209. </Border>
  210. <ControlTemplate.Triggers>
  211. <Trigger Property="IsMouseOver" Value="true">
  212. <Setter TargetName="Border" Property="Background" Value="#ffffff" />
  213. </Trigger>
  214. </ControlTemplate.Triggers>
  215. </ControlTemplate>
  216. </Setter.Value>
  217. </Setter>
  218. </Style>
  219. </ResourceDictionary>
  220. </Application.Resources>
  221. </prism:PrismApplication>