ButtonStyle.xaml 39 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726
  1. <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
  2. <ResourceDictionary.MergedDictionaries>
  3. <ResourceDictionary Source="pack://application:,,,/PDF Master;component/Styles/CustomBtnStyle.xaml" />
  4. </ResourceDictionary.MergedDictionaries>
  5. <Style x:Key="FocusVisual">
  6. <Setter Property="Control.Template">
  7. <Setter.Value>
  8. <ControlTemplate>
  9. <Rectangle
  10. Margin="2"
  11. SnapsToDevicePixels="true"
  12. Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"
  13. StrokeDashArray="1 2"
  14. StrokeThickness="1" />
  15. </ControlTemplate>
  16. </Setter.Value>
  17. </Setter>
  18. </Style>
  19. <Style x:Key="TitleBarBtn" TargetType="{x:Type Button}">
  20. <Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual}" />
  21. <Setter Property="Background" Value="{StaticResource Button.Static.Background}" />
  22. <Setter Property="BorderBrush" Value="{StaticResource Button.Static.Border}" />
  23. <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
  24. <Setter Property="BorderThickness" Value="0" />
  25. <Setter Property="HorizontalContentAlignment" Value="Center" />
  26. <Setter Property="VerticalContentAlignment" Value="Center" />
  27. <Setter Property="Padding" Value="0" />
  28. <Setter Property="Width" Value="32" />
  29. <Setter Property="Height" Value="32" />
  30. <Setter Property="IsTabStop" Value="False" />
  31. <Setter Property="Template">
  32. <Setter.Value>
  33. <ControlTemplate TargetType="{x:Type Button}">
  34. <Border
  35. x:Name="border"
  36. Background="{TemplateBinding Background}"
  37. BorderBrush="{TemplateBinding BorderBrush}"
  38. BorderThickness="{TemplateBinding BorderThickness}"
  39. SnapsToDevicePixels="true">
  40. <ContentPresenter
  41. x:Name="contentPresenter"
  42. Margin="{TemplateBinding Padding}"
  43. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  44. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  45. Focusable="False"
  46. RecognizesAccessKey="True"
  47. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  48. </Border>
  49. <ControlTemplate.Triggers>
  50. <Trigger Property="IsMouseOver" Value="true">
  51. <Setter TargetName="border" Property="Background" Value="{StaticResource color.item-state.hov.bg}" />
  52. <Setter TargetName="border" Property="BorderBrush" Value="{StaticResource Button.MouseOver.Border}" />
  53. </Trigger>
  54. <Trigger Property="IsPressed" Value="true">
  55. <Setter TargetName="border" Property="Background" Value="{StaticResource color.item-state.hov.bg}" />
  56. <Setter TargetName="border" Property="BorderBrush" Value="{StaticResource Button.Pressed.Border}" />
  57. </Trigger>
  58. <Trigger Property="IsEnabled" Value="false">
  59. <Setter TargetName="contentPresenter" Property="TextElement.Foreground" Value="{StaticResource Button.Disabled.Foreground}" />
  60. <Setter TargetName="contentPresenter" Property="Opacity" Value="0.5" />
  61. </Trigger>
  62. </ControlTemplate.Triggers>
  63. </ControlTemplate>
  64. </Setter.Value>
  65. </Setter>
  66. </Style>
  67. <Style
  68. x:Key="PageEditToolBtn"
  69. BasedOn="{StaticResource TitleBarBtn}"
  70. TargetType="{x:Type Button}">
  71. <Setter Property="Background" Value="Transparent" />
  72. <Setter Property="BorderBrush" Value="Transparent" />
  73. <Setter Property="Width" Value="auto" />
  74. <Setter Property="Height" Value="40" />
  75. <Setter Property="Template">
  76. <Setter.Value>
  77. <ControlTemplate TargetType="{x:Type Button}">
  78. <Border
  79. x:Name="border"
  80. Background="{TemplateBinding Background}"
  81. BorderBrush="{TemplateBinding BorderBrush}"
  82. BorderThickness="{TemplateBinding BorderThickness}"
  83. SnapsToDevicePixels="true">
  84. <ContentPresenter
  85. x:Name="contentPresenter"
  86. Margin="{TemplateBinding Padding}"
  87. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  88. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  89. Focusable="False"
  90. RecognizesAccessKey="True"
  91. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  92. </Border>
  93. <ControlTemplate.Triggers>
  94. <Trigger Property="IsMouseOver" Value="true">
  95. <Setter TargetName="border" Property="Background" Value="#1A000000" />
  96. <Setter TargetName="border" Property="BorderBrush" Value="{StaticResource Button.MouseOver.Border}" />
  97. </Trigger>
  98. <Trigger Property="IsPressed" Value="true">
  99. <Setter TargetName="border" Property="Background" Value="#26000000" />
  100. <Setter TargetName="border" Property="BorderBrush" Value="{StaticResource Button.Pressed.Border}" />
  101. </Trigger>
  102. <Trigger Property="IsEnabled" Value="false">
  103. <Setter TargetName="border" Property="Background" Value="Transparent" />
  104. <Setter TargetName="border" Property="BorderBrush" Value="#33000000" />
  105. <Setter TargetName="contentPresenter" Property="TextElement.Foreground" Value="#FF999999" />
  106. <Setter TargetName="contentPresenter" Property="Opacity" Value="0.4" />
  107. </Trigger>
  108. </ControlTemplate.Triggers>
  109. </ControlTemplate>
  110. </Setter.Value>
  111. </Setter>
  112. </Style>
  113. <Style
  114. x:Key="CloseBtn"
  115. BasedOn="{StaticResource TitleBarBtn}"
  116. TargetType="{x:Type Button}">
  117. <Setter Property="Template">
  118. <Setter.Value>
  119. <ControlTemplate TargetType="{x:Type Button}">
  120. <Border
  121. x:Name="border"
  122. Background="{TemplateBinding Background}"
  123. BorderBrush="{TemplateBinding BorderBrush}"
  124. BorderThickness="{TemplateBinding BorderThickness}"
  125. SnapsToDevicePixels="true">
  126. <ContentPresenter
  127. x:Name="contentPresenter"
  128. Margin="{TemplateBinding Padding}"
  129. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  130. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  131. Focusable="False"
  132. RecognizesAccessKey="True"
  133. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  134. </Border>
  135. <ControlTemplate.Triggers>
  136. <Trigger Property="IsMouseOver" Value="true">
  137. <Setter TargetName="border" Property="Background" Value="{StaticResource CloseButton.MouseOver.Foreground}" />
  138. <Setter TargetName="border" Property="BorderBrush" Value="{StaticResource Button.MouseOver.Border}" />
  139. <Setter TargetName="contentPresenter" Property="Opacity" Value="0.8" />
  140. </Trigger>
  141. </ControlTemplate.Triggers>
  142. </ControlTemplate>
  143. </Setter.Value>
  144. </Setter>
  145. </Style>
  146. <!-- 只有内容的按钮(普通状态下,没有固定的边框和背景色) -->
  147. <!--<Setter Property="Background" Value="{StaticResource Button.Static.Background}" />
  148. <Setter Property="BorderBrush" Value="{StaticResource Button.Static.Border}" />-->
  149. <Style x:Key="OnlyContentBtn" TargetType="{x:Type Button}">
  150. <Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual}" />
  151. <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
  152. <Setter Property="BorderThickness" Value="0" />
  153. <Setter Property="HorizontalContentAlignment" Value="Center" />
  154. <Setter Property="VerticalContentAlignment" Value="Center" />
  155. <Setter Property="Background" Value="Transparent" />
  156. <Setter Property="BorderBrush" Value="Transparent" />
  157. <Setter Property="Padding" Value="0" />
  158. <Setter Property="Width" Value="32" />
  159. <Setter Property="Height" Value="32" />
  160. <Setter Property="IsTabStop" Value="False" />
  161. <Setter Property="Template">
  162. <Setter.Value>
  163. <ControlTemplate TargetType="{x:Type Button}">
  164. <Border
  165. x:Name="border"
  166. Background="{TemplateBinding Background}"
  167. BorderBrush="{TemplateBinding BorderBrush}"
  168. BorderThickness="{TemplateBinding BorderThickness}"
  169. CornerRadius="4"
  170. SnapsToDevicePixels="true">
  171. <ContentPresenter
  172. x:Name="contentPresenter"
  173. Margin="{TemplateBinding Padding}"
  174. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  175. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  176. Focusable="False"
  177. RecognizesAccessKey="True"
  178. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  179. </Border>
  180. <ControlTemplate.Triggers>
  181. <Trigger Property="IsMouseOver" Value="true">
  182. <Setter TargetName="border" Property="Background" Value="{StaticResource Button.MouseOver.Background}" />
  183. <Setter TargetName="border" Property="BorderBrush" Value="{StaticResource Button.MouseOver.Border}" />
  184. </Trigger>
  185. <Trigger Property="IsPressed" Value="true">
  186. <Setter TargetName="border" Property="Background" Value="{StaticResource Button.Pressed.Background}" />
  187. <Setter TargetName="border" Property="BorderBrush" Value="{StaticResource Button.Pressed.Border}" />
  188. </Trigger>
  189. <Trigger Property="IsEnabled" Value="false">
  190. <Setter TargetName="contentPresenter" Property="TextElement.Foreground" Value="{StaticResource Button.Disabled.Foreground}" />
  191. <Setter TargetName="contentPresenter" Property="Opacity" Value="0.5" />
  192. </Trigger>
  193. </ControlTemplate.Triggers>
  194. </ControlTemplate>
  195. </Setter.Value>
  196. </Setter>
  197. </Style>
  198. <Style x:Key="NoColorBtn" TargetType="{x:Type Button}">
  199. <Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual}" />
  200. <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
  201. <Setter Property="BorderThickness" Value="0" />
  202. <Setter Property="HorizontalContentAlignment" Value="Center" />
  203. <Setter Property="VerticalContentAlignment" Value="Center" />
  204. <Setter Property="Background" Value="Transparent" />
  205. <Setter Property="BorderBrush" Value="Transparent" />
  206. <Setter Property="IsTabStop" Value="False" />
  207. <Setter Property="Template">
  208. <Setter.Value>
  209. <ControlTemplate TargetType="{x:Type Button}">
  210. <Border
  211. x:Name="border"
  212. Background="{TemplateBinding Background}"
  213. BorderBrush="{TemplateBinding BorderBrush}"
  214. BorderThickness="{TemplateBinding BorderThickness}"
  215. SnapsToDevicePixels="true">
  216. <ContentPresenter
  217. x:Name="contentPresenter"
  218. Margin="{TemplateBinding Padding}"
  219. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  220. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  221. Focusable="False"
  222. RecognizesAccessKey="True"
  223. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  224. </Border>
  225. </ControlTemplate>
  226. </Setter.Value>
  227. </Setter>
  228. </Style>
  229. <!-- 阅读模式的按钮模板样式 -->
  230. <ControlTemplate x:Key="zoomout" TargetType="{x:Type ButtonBase}">
  231. <Border
  232. Name="border"
  233. Background="{TemplateBinding Panel.Background}"
  234. BorderBrush="{TemplateBinding Border.BorderBrush}"
  235. BorderThickness="{TemplateBinding Border.BorderThickness}"
  236. SnapsToDevicePixels="True">
  237. <Path
  238. Name="content"
  239. Width="16"
  240. Height="16"
  241. HorizontalAlignment="Center"
  242. VerticalAlignment="Center"
  243. Data="M6.5,0 C10.0898509,0 13,2.91014913 13,6.5 C13,8.1223907 12.4056075,9.60595359 11.4227096,10.7448016 L15.5,14.8210176 L14.8210176,15.5 L10.7448016,11.4227096 C9.60595359,12.4056075 8.1223907,13 6.5,13 C2.91014913,13 0,10.0898509 0,6.5 C0,2.91014913 2.91014913,0 6.5,0 Z M6.5,1 C3.46243388,1 1,3.46243388 1,6.5 C1,9.53756612 3.46243388,12 6.5,12 C9.53756612,12 12,9.53756612 12,6.5 C12,3.46243388 9.53756612,1 6.5,1 Z M10,6 L10,7 L3,7 L3,6 L10,6 Z"
  244. Fill="White" />
  245. </Border>
  246. <ControlTemplate.Triggers>
  247. <Trigger Property="Button.IsDefaulted" Value="True">
  248. <Setter TargetName="content" Property="Path.Fill" Value="White" />
  249. </Trigger>
  250. <Trigger Property="UIElement.IsMouseOver" Value="True">
  251. <Setter TargetName="content" Property="Path.Fill" Value="#B3FFFFFF" />
  252. </Trigger>
  253. <Trigger Property="ButtonBase.IsPressed" Value="True">
  254. <Setter TargetName="content" Property="Path.Fill" Value="#80FFFFFF" />
  255. </Trigger>
  256. </ControlTemplate.Triggers>
  257. </ControlTemplate>
  258. <ControlTemplate x:Key="zoomin" TargetType="{x:Type ButtonBase}">
  259. <Border
  260. Name="border"
  261. Background="{TemplateBinding Panel.Background}"
  262. BorderBrush="{TemplateBinding Border.BorderBrush}"
  263. BorderThickness="{TemplateBinding Border.BorderThickness}"
  264. SnapsToDevicePixels="True">
  265. <Path
  266. Name="content"
  267. Width="16"
  268. Height="16"
  269. HorizontalAlignment="Center"
  270. VerticalAlignment="Center"
  271. Data="M6.5,0 C10.0898509,0 13,2.91014913 13,6.5 C13,8.1223907 12.4056075,9.60595359 11.4227096,10.7448016 L15.5,14.8210176 L14.8210176,15.5 L10.7448016,11.4227096 C9.60595359,12.4056075 8.1223907,13 6.5,13 C2.91014913,13 0,10.0898509 0,6.5 C0,2.91014913 2.91014913,0 6.5,0 Z M6.5,1 C3.46243388,1 1,3.46243388 1,6.5 C1,9.53756612 3.46243388,12 6.5,12 C9.53756612,12 12,9.53756612 12,6.5 C12,3.46243388 9.53756612,1 6.5,1 Z M7,3 L7,6 L10,6 L10,7 L7,7 L7,10 L6,10 L6,7 L3,7 L3,6 L6,6 L6,3 L7,3 Z"
  272. Fill="White" />
  273. </Border>
  274. <ControlTemplate.Triggers>
  275. <Trigger Property="Button.IsDefaulted" Value="True">
  276. <Setter TargetName="content" Property="Path.Fill" Value="White" />
  277. </Trigger>
  278. <Trigger Property="UIElement.IsMouseOver" Value="True">
  279. <Setter TargetName="content" Property="Path.Fill" Value="#B3FFFFFF" />
  280. </Trigger>
  281. <Trigger Property="ButtonBase.IsPressed" Value="True">
  282. <Setter TargetName="content" Property="Path.Fill" Value="#80FFFFFF" />
  283. </Trigger>
  284. </ControlTemplate.Triggers>
  285. </ControlTemplate>
  286. <ControlTemplate x:Key="prepage" TargetType="{x:Type ButtonBase}">
  287. <Border
  288. Name="border"
  289. Background="{TemplateBinding Panel.Background}"
  290. BorderBrush="{TemplateBinding Border.BorderBrush}"
  291. BorderThickness="0"
  292. SnapsToDevicePixels="True">
  293. <Polygon
  294. Name="content"
  295. Width="16"
  296. Height="16"
  297. HorizontalAlignment="Center"
  298. VerticalAlignment="Center"
  299. Fill="White"
  300. Points="10.2999705 2.5 11 3.22644971 6.39995321 8 11 12.7735503 10.2999705 13.5 5 8" />
  301. </Border>
  302. <ControlTemplate.Triggers>
  303. <Trigger Property="Button.IsDefaulted" Value="True">
  304. <Setter TargetName="content" Property="Path.Fill" Value="White" />
  305. </Trigger>
  306. <Trigger Property="UIElement.IsMouseOver" Value="True">
  307. <Setter TargetName="content" Property="Path.Fill" Value="#B3FFFFFF" />
  308. </Trigger>
  309. <Trigger Property="ButtonBase.IsPressed" Value="True">
  310. <Setter TargetName="content" Property="Path.Fill" Value="#80FFFFFF" />
  311. </Trigger>
  312. </ControlTemplate.Triggers>
  313. </ControlTemplate>
  314. <ControlTemplate x:Key="nextpage" TargetType="{x:Type ButtonBase}">
  315. <Border
  316. Name="border"
  317. Background="{TemplateBinding Panel.Background}"
  318. BorderBrush="{TemplateBinding Border.BorderBrush}"
  319. BorderThickness="0"
  320. SnapsToDevicePixels="True">
  321. <Polygon
  322. x:Name="content"
  323. Width="16"
  324. Height="16"
  325. Fill="White"
  326. Points="10.2999705 2.5 11 3.22644971 6.39995321 8 11 12.7735503 10.2999705 13.5 5 8">
  327. <Polygon.RenderTransform>
  328. <TransformGroup>
  329. <TranslateTransform X="-8" Y="8" />
  330. <ScaleTransform ScaleX="-1" ScaleY="1" />
  331. <TranslateTransform X="8" Y="-8" />
  332. </TransformGroup>
  333. </Polygon.RenderTransform>
  334. </Polygon>
  335. </Border>
  336. <ControlTemplate.Triggers>
  337. <Trigger Property="Button.IsDefaulted" Value="True">
  338. <Setter TargetName="content" Property="Path.Fill" Value="White" />
  339. </Trigger>
  340. <Trigger Property="UIElement.IsMouseOver" Value="True">
  341. <Setter TargetName="content" Property="Path.Fill" Value="#B3FFFFFF" />
  342. </Trigger>
  343. <Trigger Property="ButtonBase.IsPressed" Value="True">
  344. <Setter TargetName="content" Property="Path.Fill" Value="#80FFFFFF" />
  345. </Trigger>
  346. </ControlTemplate.Triggers>
  347. </ControlTemplate>
  348. <!-- ControlTemplate For Button With Corner 4 -->
  349. <ControlTemplate x:Key="ButtonControlTemplateWithCorner4" TargetType="{x:Type Button}">
  350. <Border
  351. x:Name="border"
  352. Background="{TemplateBinding Background}"
  353. BorderBrush="{TemplateBinding BorderBrush}"
  354. BorderThickness="{TemplateBinding BorderThickness}"
  355. CornerRadius="{StaticResource radius.base.m}"
  356. SnapsToDevicePixels="true">
  357. <ContentPresenter
  358. x:Name="contentPresenter"
  359. Margin="{TemplateBinding Padding}"
  360. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  361. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  362. Focusable="False"
  363. RecognizesAccessKey="True"
  364. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  365. </Border>
  366. </ControlTemplate>
  367. <ControlTemplate x:Key="ButtonControlTemplateWithCorner20" TargetType="{x:Type Button}">
  368. <Border
  369. x:Name="border"
  370. Background="{TemplateBinding Background}"
  371. BorderBrush="{TemplateBinding BorderBrush}"
  372. BorderThickness="{TemplateBinding BorderThickness}"
  373. CornerRadius="{StaticResource radius.fullround-btn.l}"
  374. SnapsToDevicePixels="true">
  375. <ContentPresenter
  376. x:Name="contentPresenter"
  377. Margin="{TemplateBinding Padding}"
  378. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  379. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  380. Focusable="False"
  381. RecognizesAccessKey="True"
  382. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  383. </Border>
  384. </ControlTemplate>
  385. <!--
  386. Style for Btn.cta
  387. 样式里仅设置了背景色和文字颜色变化,字体大小和控件宽度需要调用时设置
  388. -->
  389. <Style x:Key="Btn.cta" TargetType="{x:Type Button}">
  390. <Setter Property="FocusVisualStyle" Value="{x:Null}" />
  391. <Setter Property="Background" Value="{StaticResource color.btn.cta.bg.norm}" />
  392. <Setter Property="BorderBrush" Value="{StaticResource color.btn.cta.bg.norm}" />
  393. <Setter Property="Foreground" Value="{StaticResource color.btn.cta.text.def}" />
  394. <Setter Property="FontFamily" Value="Segoe UI" />
  395. <Setter Property="FontWeight" Value="Regular" />
  396. <Setter Property="BorderThickness" Value="0" />
  397. <Setter Property="HorizontalContentAlignment" Value="Center" />
  398. <Setter Property="VerticalContentAlignment" Value="Center" />
  399. <Setter Property="Padding" Value="1" />
  400. <Setter Property="Template" Value="{StaticResource ButtonControlTemplateWithCorner4}" />
  401. <Style.Triggers>
  402. <Trigger Property="IsDefaulted" Value="true">
  403. <Setter Property="BorderBrush" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}" />
  404. </Trigger>
  405. <Trigger Property="IsMouseOver" Value="true">
  406. <Setter Property="Background" Value="{StaticResource color.btn.cta.bg.hov}" />
  407. <Setter Property="BorderBrush" Value="{StaticResource color.btn.cta.bg.hov}" />
  408. </Trigger>
  409. <Trigger Property="IsPressed" Value="true">
  410. <Setter Property="Background" Value="{StaticResource color.btn.cta.bg.act}" />
  411. <Setter Property="BorderBrush" Value="{StaticResource color.btn.cta.bg.act}" />
  412. </Trigger>
  413. <Trigger Property="IsEnabled" Value="false">
  414. <Setter Property="Background" Value="{StaticResource color.btn.cta.bg.dis}" />
  415. <Setter Property="BorderBrush" Value="{StaticResource color.btn.cta.bg.dis}" />
  416. <Setter Property="Foreground" Value="{StaticResource color.btn.cta.text.dis}" />
  417. </Trigger>
  418. </Style.Triggers>
  419. </Style>
  420. <!-- Design Token Btn.Brand -->
  421. <Style
  422. x:Key="btn.brand"
  423. BasedOn="{StaticResource Btn.cta}"
  424. TargetType="{x:Type Button}">
  425. <Setter Property="Background" Value="{StaticResource color.btn.brand.bg.norm}" />
  426. <Setter Property="Foreground" Value="{StaticResource color.btn.brand.text.def}" />
  427. <Style.Triggers>
  428. <Trigger Property="IsDefaulted" Value="true">
  429. <Setter Property="BorderBrush" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}" />
  430. </Trigger>
  431. <Trigger Property="IsMouseOver" Value="true">
  432. <Setter Property="Background" Value="{StaticResource color.btn.brand.bg.hov}" />
  433. <Setter Property="BorderBrush" Value="{StaticResource color.btn.brand.bg.hov}" />
  434. </Trigger>
  435. <Trigger Property="IsPressed" Value="true">
  436. <Setter Property="Background" Value="{StaticResource color.btn.brand.bg.act}" />
  437. <Setter Property="BorderBrush" Value="{StaticResource color.btn.brand.bg.act}" />
  438. </Trigger>
  439. <Trigger Property="IsEnabled" Value="false">
  440. <Setter Property="Background" Value="{StaticResource color.btn.brand.bg.dis}" />
  441. <Setter Property="BorderBrush" Value="{StaticResource color.btn.brand.bg.dis}" />
  442. <Setter Property="Foreground" Value="{StaticResource color.btn.brand.text.dis}" />
  443. </Trigger>
  444. </Style.Triggers>
  445. </Style>
  446. <!-- Design Token Btn.Sec -->
  447. <Style
  448. x:Key="btn.sec"
  449. BasedOn="{StaticResource Btn.cta}"
  450. TargetType="{x:Type Button}">
  451. <Setter Property="Background" Value="{StaticResource color.btn.sec.bg.norm}" />
  452. <Setter Property="Foreground" Value="{StaticResource color.btn.sec.text.def}" />
  453. <Setter Property="BorderBrush" Value="{StaticResource color.btn.sec.border-color}" />
  454. <Setter Property="BorderThickness" Value="{StaticResource border-width.1}" />
  455. <Style.Triggers>
  456. <Trigger Property="IsDefaulted" Value="true">
  457. <Setter Property="BorderBrush" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}" />
  458. </Trigger>
  459. <Trigger Property="IsMouseOver" Value="true">
  460. <Setter Property="Background" Value="{StaticResource color.btn.sec.bg.hov}" />
  461. <Setter Property="BorderBrush" Value="{StaticResource color.btn.sec.border-color}" />
  462. </Trigger>
  463. <Trigger Property="IsPressed" Value="true">
  464. <Setter Property="Background" Value="{StaticResource color.btn.sec.bg.act}" />
  465. <Setter Property="BorderBrush" Value="{StaticResource color.btn.sec.border-color}" />
  466. </Trigger>
  467. <Trigger Property="IsEnabled" Value="false">
  468. <Setter Property="Background" Value="{StaticResource color.btn.sec.bg.dis}" />
  469. <Setter Property="Foreground" Value="{StaticResource color.btn.sec.text.dis}" />
  470. </Trigger>
  471. </Style.Triggers>
  472. </Style>
  473. <!-- Design Token Btn.Sec-icon -->
  474. <Style
  475. x:Key="btn.sec-icon"
  476. BasedOn="{StaticResource btn.sec}"
  477. TargetType="{x:Type Button}" />
  478. <!-- Design Token Btn.Link -->
  479. <Style
  480. x:Key="btn.link"
  481. BasedOn="{StaticResource Btn.cta}"
  482. TargetType="{x:Type Button}">
  483. <Setter Property="Background" Value="Transparent" />
  484. <Setter Property="Foreground" Value="{StaticResource color.btn.link.text.norm}" />
  485. <Setter Property="BorderThickness" Value="0" />
  486. <Style.Triggers>
  487. <Trigger Property="IsMouseOver" Value="true">
  488. <Setter Property="Foreground" Value="{StaticResource color.btn.link.text.hov}" />
  489. <Setter Property="Background" Value="Transparent" />
  490. </Trigger>
  491. <Trigger Property="IsPressed" Value="true">
  492. <Setter Property="Foreground" Value="{StaticResource color.btn.link.text.act}" />
  493. <Setter Property="Background" Value="Transparent" />
  494. </Trigger>
  495. <Trigger Property="IsEnabled" Value="false">
  496. <Setter Property="Foreground" Value="{StaticResource color.btn.link.text.dis}" />
  497. <Setter Property="Background" Value="Transparent" />
  498. </Trigger>
  499. </Style.Triggers>
  500. </Style>
  501. <!-- Design Token Btn.Ghost -->
  502. <Style
  503. x:Key="btn.ghost"
  504. BasedOn="{StaticResource Btn.cta}"
  505. TargetType="{x:Type Button}">
  506. <Setter Property="Background" Value="Transparent" />
  507. <Setter Property="BorderBrush" Value="{StaticResource color.btn.ghost.border.norm}" />
  508. <Setter Property="Foreground" Value="{StaticResource color.btn.ghost.text.norm}" />
  509. <Setter Property="BorderThickness" Value="{StaticResource border-width.1}" />
  510. <Style.Triggers>
  511. <Trigger Property="IsDefaulted" Value="true">
  512. <Setter Property="BorderBrush" Value="{StaticResource color.btn.ghost.border.norm}" />
  513. </Trigger>
  514. <Trigger Property="IsMouseOver" Value="true">
  515. <Setter Property="BorderBrush" Value="{StaticResource color.btn.ghost.border.hov}" />
  516. </Trigger>
  517. <Trigger Property="IsPressed" Value="true">
  518. <Setter Property="BorderBrush" Value="{StaticResource color.btn.ghost.border.act}" />
  519. </Trigger>
  520. <Trigger Property="IsEnabled" Value="false">
  521. <Setter Property="BorderBrush" Value="{StaticResource color.btn.ghost.border.dis}" />
  522. <Setter Property="Foreground" Value="{StaticResource color.btn.ghost.text.dis}" />
  523. </Trigger>
  524. </Style.Triggers>
  525. </Style>
  526. <!-- Design Token Btn.icon-Fill -->
  527. <Style
  528. x:Key="btn.icon-fill"
  529. BasedOn="{StaticResource Btn.cta}"
  530. TargetType="{x:Type Button}">
  531. <Setter Property="Background" Value="{StaticResource color.btn.icon-fill.bg.norm}" />
  532. <Setter Property="BorderThickness" Value="0" />
  533. <Style.Triggers>
  534. <Trigger Property="IsDefaulted" Value="true">
  535. <Setter Property="Background" Value="{StaticResource color.btn.icon-fill.bg.norm}" />
  536. </Trigger>
  537. <Trigger Property="IsMouseOver" Value="true">
  538. <Setter Property="Background" Value="{StaticResource color.btn.icon-fill.bg.hov}" />
  539. </Trigger>
  540. <Trigger Property="IsPressed" Value="true">
  541. <Setter Property="Background" Value="{StaticResource color.btn.icon-fill.bg.act}" />
  542. </Trigger>
  543. <Trigger Property="IsEnabled" Value="false">
  544. <Setter Property="Background" Value="{StaticResource color.btn.icon-fill.bg.dis}" />
  545. </Trigger>
  546. </Style.Triggers>
  547. </Style>
  548. <!-- Design Token Btn.Upgrade -->
  549. <Style
  550. x:Key="btn.upgrade"
  551. BasedOn="{StaticResource Btn.cta}"
  552. TargetType="{x:Type Button}">
  553. <Setter Property="Template" Value="{StaticResource ButtonControlTemplateWithCorner20}" />
  554. <Setter Property="Background" Value="{StaticResource color.btn.upgrade.bg.norm}" />
  555. <Setter Property="Foreground" Value="{StaticResource color.btn.upgrade.text.def}" />
  556. <Setter Property="BorderThickness" Value="0" />
  557. <Style.Triggers>
  558. <Trigger Property="IsDefaulted" Value="true">
  559. <Setter Property="Background" Value="{StaticResource color.btn.upgrade.bg.norm}" />
  560. </Trigger>
  561. <Trigger Property="IsMouseOver" Value="true">
  562. <Setter Property="Background" Value="{StaticResource color.btn.upgrade.bg.hov}" />
  563. </Trigger>
  564. <Trigger Property="IsPressed" Value="true">
  565. <Setter Property="Background" Value="{StaticResource color.btn.upgrade.bg.act}" />
  566. </Trigger>
  567. <Trigger Property="IsEnabled" Value="false">
  568. <Setter Property="Background" Value="{StaticResource color.btn.upgrade.bg.dis}" />
  569. <Setter Property="Foreground" Value="{StaticResource color.btn.upgrade.text.dis}" />
  570. </Trigger>
  571. </Style.Triggers>
  572. </Style>
  573. <!-- Design Token SubToolBar Style -->
  574. <Style
  575. x:Key="subToolBar"
  576. BasedOn="{StaticResource Btn.cta}"
  577. TargetType="{x:Type Button}">
  578. <Setter Property="Template" Value="{StaticResource ButtonControlTemplateWithCorner4}" />
  579. <Setter Property="Background" Value="Transparent" />
  580. <Setter Property="Foreground" Value="{StaticResource color.sys.text.neutral.lv1}" />
  581. <Setter Property="BorderThickness" Value="0" />
  582. <Setter Property="Width" Value="28" />
  583. <Setter Property="Height" Value="28" />
  584. <Style.Triggers>
  585. <Trigger Property="IsDefaulted" Value="true">
  586. <Setter Property="Background" Value="Transparent" />
  587. </Trigger>
  588. <Trigger Property="IsMouseOver" Value="true">
  589. <Setter Property="Background" Value="{StaticResource color.item-state.sel.bg.lv2}" />
  590. </Trigger>
  591. <Trigger Property="IsPressed" Value="true">
  592. <Setter Property="Background" Value="{StaticResource color.item-state.sel.bg.lv2}" />
  593. </Trigger>
  594. <Trigger Property="IsEnabled" Value="false">
  595. <Setter Property="Background" Value="Transparent" />
  596. <Setter Property="Opacity" Value="0.6" />
  597. <Setter Property="Foreground" Value="{StaticResource color.sys.text.neutral.dis}" />
  598. </Trigger>
  599. </Style.Triggers>
  600. </Style>
  601. <!-- Design Token Pagination.Selector style -->
  602. <Style
  603. x:Key="btn.selector"
  604. BasedOn="{StaticResource Btn.cta}"
  605. TargetType="{x:Type Button}">
  606. <Setter Property="Template" Value="{StaticResource ButtonControlTemplateWithCorner4}" />
  607. <Setter Property="Background" Value="White" />
  608. <Setter Property="Foreground" Value="{StaticResource color.icon.base.neutral.norm.lv1}" />
  609. <Setter Property="BorderBrush" Value="{StaticResource color.field.border.norm}" />
  610. <Setter Property="BorderThickness" Value="1" />
  611. <Setter Property="Width" Value="24" />
  612. <Setter Property="Height" Value="24" />
  613. <Style.Triggers>
  614. <Trigger Property="IsDefaulted" Value="true">
  615. <Setter Property="Background" Value="White" />
  616. </Trigger>
  617. <Trigger Property="IsMouseOver" Value="true">
  618. <Setter Property="Background" Value="{StaticResource color.item-state.hov.bg}" />
  619. <Setter Property="BorderBrush" Value="{StaticResource color.field.border.norm}" />
  620. </Trigger>
  621. <Trigger Property="IsPressed" Value="true">
  622. <Setter Property="Background" Value="{StaticResource color.item-state.hov.bg}" />
  623. <Setter Property="BorderBrush" Value="{StaticResource color.field.border.norm}" />
  624. </Trigger>
  625. <Trigger Property="IsEnabled" Value="false">
  626. <Setter Property="Background" Value="{StaticResource color.field.bg.dis}" />
  627. <Setter Property="BorderBrush" Value="{StaticResource color.field.border.norm}" />
  628. <Setter Property="Foreground" Value="{StaticResource color.icon.base.neutral.dis}" />
  629. </Trigger>
  630. </Style.Triggers>
  631. </Style>
  632. <Style x:Key="OpenPDFFileBtn" TargetType="{x:Type Button}">
  633. <Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual}" />
  634. <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
  635. <Setter Property="BorderThickness" Value="2" />
  636. <Setter Property="HorizontalContentAlignment" Value="Center" />
  637. <Setter Property="VerticalContentAlignment" Value="Center" />
  638. <Setter Property="Background" Value="Transparent" />
  639. <Setter Property="BorderBrush" Value="{StaticResource color.sys.border.neutral.lv1}" />
  640. <Setter Property="IsTabStop" Value="False" />
  641. <Setter Property="Template">
  642. <Setter.Value>
  643. <ControlTemplate TargetType="{x:Type Button}">
  644. <Border
  645. x:Name="border"
  646. CornerRadius="8"
  647. Background="{TemplateBinding Background}"
  648. BorderThickness="{TemplateBinding BorderThickness}"
  649. SnapsToDevicePixels="true">
  650. <Border.BorderBrush>
  651. <VisualBrush>
  652. <VisualBrush.Visual>
  653. <Grid>
  654. <Rectangle Name="Normalnormal" StrokeDashArray="4 2" RadiusX="8" RadiusY="8" Stroke="{TemplateBinding BorderBrush}"
  655. Width="{Binding RelativeSource={RelativeSource AncestorType={x:Type Border}}, Path=ActualWidth}"
  656. Height="{Binding RelativeSource={RelativeSource AncestorType={x:Type Border}}, Path=ActualHeight}">
  657. </Rectangle>
  658. <Rectangle Name="MouseOverRectangle" RadiusX="8" RadiusY="8" Stroke="{TemplateBinding BorderBrush}"
  659. Width="{Binding RelativeSource={RelativeSource AncestorType={x:Type Border}}, Path=ActualWidth}"
  660. Height="{Binding RelativeSource={RelativeSource AncestorType={x:Type Border}}, Path=ActualHeight}" Visibility="Hidden">
  661. </Rectangle>
  662. </Grid>
  663. </VisualBrush.Visual>
  664. </VisualBrush>
  665. </Border.BorderBrush>
  666. <ContentPresenter
  667. x:Name="contentPresenter"
  668. Margin="{TemplateBinding Padding}"
  669. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  670. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  671. Focusable="False"
  672. RecognizesAccessKey="True"
  673. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  674. </Border>
  675. <ControlTemplate.Triggers>
  676. <Trigger Property="IsMouseOver" Value="true">
  677. <Setter TargetName="Normalnormal" Property="Visibility" Value="Hidden" />
  678. <Setter TargetName="MouseOverRectangle" Property="Visibility" Value="Visible" />
  679. </Trigger>
  680. <Trigger Property="IsPressed" Value="true">
  681. <Setter TargetName="Normalnormal" Property="Visibility" Value="Hidden" />
  682. <Setter TargetName="MouseOverRectangle" Property="Visibility" Value="Visible" />
  683. </Trigger>
  684. </ControlTemplate.Triggers>
  685. </ControlTemplate>
  686. </Setter.Value>
  687. </Setter>
  688. <Style.Triggers>
  689. <Trigger Property="IsDefaulted" Value="true">
  690. <Setter Property="Background" Value="White" />
  691. </Trigger>
  692. <Trigger Property="IsMouseOver" Value="true">
  693. <Setter Property="Background" Value="{StaticResource color.item-state.hov.bg}" />
  694. <Setter Property="BorderBrush" Value="{StaticResource color.field.border.hov}" />
  695. </Trigger>
  696. <Trigger Property="IsPressed" Value="true">
  697. <Setter Property="Background" Value="{StaticResource color.item-state.hov.bg}" />
  698. <Setter Property="BorderBrush" Value="{StaticResource color.btn.cta.bg.act}" />
  699. </Trigger>
  700. <Trigger Property="IsEnabled" Value="false">
  701. <Setter Property="Background" Value="{StaticResource color.field.bg.dis}" />
  702. <Setter Property="BorderBrush" Value="{StaticResource color.field.border.norm}" />
  703. <Setter Property="Foreground" Value="{StaticResource color.icon.base.neutral.dis}" />
  704. </Trigger>
  705. </Style.Triggers>
  706. </Style>
  707. </ResourceDictionary>