RadioButtonStyle.xaml 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579
  1. <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
  2. <Style x:Key="OptionMarkFocusVisual">
  3. <Setter Property="Control.Template">
  4. <Setter.Value>
  5. <ControlTemplate>
  6. <Rectangle
  7. Margin="14,0,0,0"
  8. SnapsToDevicePixels="true"
  9. Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"
  10. StrokeDashArray="1 2"
  11. StrokeThickness="1" />
  12. </ControlTemplate>
  13. </Setter.Value>
  14. </Setter>
  15. </Style>
  16. <Style x:Key="FocusVisual">
  17. <Setter Property="Control.Template">
  18. <Setter.Value>
  19. <ControlTemplate>
  20. <Rectangle
  21. Margin="2"
  22. SnapsToDevicePixels="true"
  23. Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"
  24. StrokeDashArray="1 2"
  25. StrokeThickness="1" />
  26. </ControlTemplate>
  27. </Setter.Value>
  28. </Setter>
  29. </Style>
  30. <SolidColorBrush x:Key="RadioButton.Static.Background" Color="#FFFFFFFF" />
  31. <SolidColorBrush x:Key="RadioButton.Static.Border" Color="#FF707070" />
  32. <SolidColorBrush x:Key="RadioButton.MouseOver.Background" Color="#1A000000" />
  33. <SolidColorBrush x:Key="RadioButton.MouseOver.Border" Color="#FF5593FF" />
  34. <SolidColorBrush x:Key="RadioButton.MouseOver.Glyph" Color="#FFF3F9FF" />
  35. <SolidColorBrush x:Key="RadioButton.Disabled.Background" Color="#00000000" />
  36. <SolidColorBrush x:Key="RadioButton.Disabled.Border" Color="#FFBCBCBC" />
  37. <SolidColorBrush x:Key="RadioButton.Disabled.Glyph" Color="#FF707070" />
  38. <SolidColorBrush x:Key="RadioButton.Pressed.Background" Color="#26000000" />
  39. <SolidColorBrush x:Key="RadioButton.Pressed.Border" Color="#FF3C77DD" />
  40. <SolidColorBrush x:Key="RadioButton.Pressed.Glyph" Color="#1A477EDE" />
  41. <SolidColorBrush x:Key="RadioButton.Static.Glyph" Color="#FF212121" />
  42. <!-- 填充颜色 -->
  43. <SolidColorBrush x:Key="Separator.fill" Color="#1A000000" />
  44. <SolidColorBrush x:Key="MenuIco.fill" Color="#000000" />
  45. <Style x:Key="PageViewRadioBtn" TargetType="{x:Type RadioButton}">
  46. <Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual}" />
  47. <Setter Property="Background" Value="{StaticResource RadioButton.Static.Background}" />
  48. <Setter Property="BorderBrush" Value="{StaticResource RadioButton.Static.Border}" />
  49. <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
  50. <Setter Property="BorderThickness" Value="0" />
  51. <Setter Property="Width" Value="68" />
  52. <Setter Property="Height" Value="80" />
  53. <Setter Property="HorizontalContentAlignment" Value="Center" />
  54. <Setter Property="VerticalContentAlignment" Value="Center" />
  55. <Setter Property="Template">
  56. <Setter.Value>
  57. <ControlTemplate TargetType="{x:Type RadioButton}">
  58. <Grid
  59. x:Name="templateRoot"
  60. Background="Transparent"
  61. SnapsToDevicePixels="True">
  62. <Border
  63. x:Name="radioButtonBorder"
  64. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  65. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  66. Background="{TemplateBinding Background}"
  67. BorderBrush="{TemplateBinding BorderBrush}"
  68. BorderThickness="{TemplateBinding BorderThickness}"
  69. CornerRadius="4">
  70. <Rectangle
  71. x:Name="optionMark"
  72. Width="{TemplateBinding Width}"
  73. Height="{TemplateBinding Height}"
  74. Opacity="0" />
  75. </Border>
  76. <ContentPresenter
  77. x:Name="contentPresenter"
  78. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  79. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  80. Focusable="False"
  81. RecognizesAccessKey="True"
  82. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  83. </Grid>
  84. <ControlTemplate.Triggers>
  85. <Trigger Property="HasContent" Value="true">
  86. <Setter Property="FocusVisualStyle" Value="{StaticResource OptionMarkFocusVisual}" />
  87. <Setter Property="Padding" Value="4,-1,0,0" />
  88. </Trigger>
  89. <Trigger Property="IsMouseOver" Value="true">
  90. <Setter TargetName="radioButtonBorder" Property="Background" Value="{StaticResource RadioButton.MouseOver.Background}" />
  91. <Setter TargetName="radioButtonBorder" Property="BorderBrush" Value="{StaticResource RadioButton.MouseOver.Border}" />
  92. <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource RadioButton.MouseOver.Glyph}" />
  93. </Trigger>
  94. <Trigger Property="IsEnabled" Value="false">
  95. <Setter TargetName="radioButtonBorder" Property="Background" Value="{StaticResource RadioButton.Disabled.Background}" />
  96. <Setter TargetName="radioButtonBorder" Property="BorderBrush" Value="{StaticResource RadioButton.Disabled.Border}" />
  97. <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource RadioButton.Disabled.Glyph}" />
  98. </Trigger>
  99. <Trigger Property="IsPressed" Value="true">
  100. <Setter TargetName="radioButtonBorder" Property="Background" Value="{StaticResource RadioButton.Pressed.Background}" />
  101. <Setter TargetName="radioButtonBorder" Property="BorderBrush" Value="{StaticResource RadioButton.Pressed.Border}" />
  102. <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource RadioButton.Pressed.Glyph}" />
  103. </Trigger>
  104. <Trigger Property="IsChecked" Value="true">
  105. <Setter TargetName="optionMark" Property="Opacity" Value="1" />
  106. <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource RadioButton.Pressed.Glyph}" />
  107. </Trigger>
  108. <Trigger Property="IsChecked" Value="{x:Null}">
  109. <Setter TargetName="optionMark" Property="Opacity" Value="0.56" />
  110. </Trigger>
  111. </ControlTemplate.Triggers>
  112. </ControlTemplate>
  113. </Setter.Value>
  114. </Setter>
  115. </Style>
  116. <Style x:Key="SplitModeViewRadioBtn" TargetType="{x:Type RadioButton}">
  117. <Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual}" />
  118. <Setter Property="Background" Value="{StaticResource RadioButton.Static.Background}" />
  119. <Setter Property="BorderBrush" Value="{StaticResource RadioButton.Static.Border}" />
  120. <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
  121. <Setter Property="BorderThickness" Value="0" />
  122. <Setter Property="Width" Value="76" />
  123. <Setter Property="Height" Value="80" />
  124. <Setter Property="HorizontalContentAlignment" Value="Center" />
  125. <Setter Property="VerticalContentAlignment" Value="Center" />
  126. <Setter Property="Template">
  127. <Setter.Value>
  128. <ControlTemplate TargetType="{x:Type RadioButton}">
  129. <Grid
  130. x:Name="templateRoot"
  131. Background="Transparent"
  132. SnapsToDevicePixels="True">
  133. <Border
  134. x:Name="radioButtonBorder"
  135. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  136. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  137. Background="{TemplateBinding Background}"
  138. BorderBrush="{TemplateBinding BorderBrush}"
  139. BorderThickness="{TemplateBinding BorderThickness}">
  140. <Rectangle
  141. x:Name="optionMark"
  142. Width="{TemplateBinding Width}"
  143. Height="{TemplateBinding Height}"
  144. Opacity="0" />
  145. </Border>
  146. <ContentPresenter
  147. x:Name="contentPresenter"
  148. Margin="{TemplateBinding Padding}"
  149. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  150. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  151. Focusable="False"
  152. RecognizesAccessKey="True"
  153. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  154. </Grid>
  155. <ControlTemplate.Triggers>
  156. <Trigger Property="HasContent" Value="true">
  157. <Setter Property="FocusVisualStyle" Value="{StaticResource OptionMarkFocusVisual}" />
  158. <Setter Property="Padding" Value="4,-1,0,0" />
  159. </Trigger>
  160. <Trigger Property="IsMouseOver" Value="true">
  161. <Setter TargetName="radioButtonBorder" Property="Background" Value="{StaticResource RadioButton.MouseOver.Background}" />
  162. <Setter TargetName="radioButtonBorder" Property="BorderBrush" Value="{StaticResource RadioButton.MouseOver.Border}" />
  163. <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource RadioButton.MouseOver.Glyph}" />
  164. </Trigger>
  165. <Trigger Property="IsEnabled" Value="false">
  166. <Setter TargetName="radioButtonBorder" Property="Background" Value="{StaticResource RadioButton.Disabled.Background}" />
  167. <Setter TargetName="radioButtonBorder" Property="BorderBrush" Value="{StaticResource RadioButton.Disabled.Border}" />
  168. <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource RadioButton.Disabled.Glyph}" />
  169. </Trigger>
  170. <Trigger Property="IsPressed" Value="true">
  171. <Setter TargetName="radioButtonBorder" Property="Background" Value="{StaticResource RadioButton.Pressed.Background}" />
  172. <Setter TargetName="radioButtonBorder" Property="BorderBrush" Value="{StaticResource RadioButton.Pressed.Border}" />
  173. <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource RadioButton.Pressed.Glyph}" />
  174. </Trigger>
  175. <Trigger Property="IsChecked" Value="true">
  176. <Setter TargetName="optionMark" Property="Opacity" Value="1" />
  177. <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource RadioButton.Pressed.Glyph}" />
  178. </Trigger>
  179. <Trigger Property="IsChecked" Value="{x:Null}">
  180. <Setter TargetName="optionMark" Property="Opacity" Value="0.56" />
  181. </Trigger>
  182. </ControlTemplate.Triggers>
  183. </ControlTemplate>
  184. </Setter.Value>
  185. </Setter>
  186. </Style>
  187. <Style x:Key="ViewModeViewRadioBtn" TargetType="{x:Type RadioButton}">
  188. <Setter Property="FocusVisualStyle" Value="{x:Null}" />
  189. <Setter Property="Background" Value="{StaticResource RadioButton.Static.Background}" />
  190. <Setter Property="BorderBrush" Value="{StaticResource RadioButton.Static.Border}" />
  191. <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
  192. <Setter Property="BorderThickness" Value="0" />
  193. <Setter Property="Width" Value="72" />
  194. <Setter Property="Height" Value="80" />
  195. <Setter Property="HorizontalContentAlignment" Value="Center" />
  196. <Setter Property="VerticalContentAlignment" Value="Center" />
  197. <Setter Property="Template">
  198. <Setter.Value>
  199. <ControlTemplate TargetType="{x:Type RadioButton}">
  200. <Grid
  201. x:Name="templateRoot"
  202. Background="Transparent"
  203. SnapsToDevicePixels="True">
  204. <Border
  205. x:Name="radioButtonBorder"
  206. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  207. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  208. Background="{TemplateBinding Background}"
  209. BorderBrush="{TemplateBinding BorderBrush}"
  210. BorderThickness="{TemplateBinding BorderThickness}">
  211. <Rectangle
  212. x:Name="optionMark"
  213. Width="{TemplateBinding Width}"
  214. Height="{TemplateBinding Height}"
  215. Opacity="0" />
  216. </Border>
  217. <ContentPresenter
  218. x:Name="contentPresenter"
  219. Margin="{TemplateBinding Padding}"
  220. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  221. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  222. Focusable="False"
  223. RecognizesAccessKey="True"
  224. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  225. </Grid>
  226. <ControlTemplate.Triggers>
  227. <Trigger Property="HasContent" Value="true">
  228. <Setter Property="FocusVisualStyle" Value="{x:Null}" />
  229. <Setter Property="Padding" Value="4,-1,0,0" />
  230. </Trigger>
  231. <Trigger Property="IsMouseOver" Value="true">
  232. <Setter TargetName="radioButtonBorder" Property="Background" Value="{StaticResource RadioButton.MouseOver.Background}" />
  233. <Setter TargetName="radioButtonBorder" Property="BorderBrush" Value="{StaticResource RadioButton.MouseOver.Border}" />
  234. <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource RadioButton.MouseOver.Glyph}" />
  235. </Trigger>
  236. <Trigger Property="IsEnabled" Value="false">
  237. <Setter TargetName="radioButtonBorder" Property="Background" Value="{StaticResource RadioButton.Disabled.Background}" />
  238. <Setter TargetName="radioButtonBorder" Property="BorderBrush" Value="{StaticResource RadioButton.Disabled.Border}" />
  239. <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource RadioButton.Disabled.Glyph}" />
  240. </Trigger>
  241. <Trigger Property="IsPressed" Value="true">
  242. <Setter TargetName="radioButtonBorder" Property="Background" Value="{StaticResource RadioButton.Pressed.Background}" />
  243. <Setter TargetName="radioButtonBorder" Property="BorderBrush" Value="{StaticResource RadioButton.Pressed.Border}" />
  244. <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource RadioButton.Pressed.Glyph}" />
  245. </Trigger>
  246. <Trigger Property="IsChecked" Value="true">
  247. <Setter TargetName="optionMark" Property="Opacity" Value="1" />
  248. <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource RadioButton.Pressed.Glyph}" />
  249. </Trigger>
  250. <Trigger Property="IsChecked" Value="{x:Null}">
  251. <Setter TargetName="optionMark" Property="Opacity" Value="0.56" />
  252. </Trigger>
  253. </ControlTemplate.Triggers>
  254. </ControlTemplate>
  255. </Setter.Value>
  256. </Setter>
  257. </Style>
  258. <!-- 最近列表列表模式单选按钮 -->
  259. <Style x:Key="ListModeRadioBtnStyle" TargetType="{x:Type RadioButton}">
  260. <Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual}" />
  261. <Setter Property="Background" Value="{StaticResource RadioButton.Static.Background}" />
  262. <Setter Property="BorderBrush" Value="{StaticResource RadioButton.Static.Border}" />
  263. <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
  264. <Setter Property="Template">
  265. <Setter.Value>
  266. <ControlTemplate TargetType="{x:Type RadioButton}">
  267. <Border
  268. x:Name="root"
  269. Background="#EEF2F3"
  270. CornerRadius="4">
  271. <Grid
  272. x:Name="templateRoot"
  273. HorizontalAlignment="Center"
  274. VerticalAlignment="Center"
  275. SnapsToDevicePixels="True">
  276. <Grid.ColumnDefinitions>
  277. <ColumnDefinition Width="Auto" />
  278. <ColumnDefinition Width="*" />
  279. </Grid.ColumnDefinitions>
  280. <Border
  281. x:Name="radioButtonBorder"
  282. Margin="1,1,2,1"
  283. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  284. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  285. Background="{TemplateBinding Background}"
  286. BorderBrush="{TemplateBinding BorderBrush}"
  287. BorderThickness="{TemplateBinding BorderThickness}"
  288. CornerRadius="100"
  289. Visibility="Collapsed">
  290. <Grid x:Name="markGrid" Margin="2">
  291. <Ellipse
  292. x:Name="optionMark"
  293. MinWidth="6"
  294. MinHeight="6"
  295. Fill="{StaticResource RadioButton.Static.Glyph}"
  296. Opacity="0" />
  297. </Grid>
  298. </Border>
  299. <ContentPresenter
  300. x:Name="contentPresenter"
  301. Grid.Column="1"
  302. Margin="{TemplateBinding Padding}"
  303. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  304. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  305. Focusable="False"
  306. RecognizesAccessKey="True"
  307. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  308. </Grid>
  309. </Border>
  310. <ControlTemplate.Triggers>
  311. <Trigger Property="HasContent" Value="true">
  312. <Setter Property="FocusVisualStyle" Value="{StaticResource OptionMarkFocusVisual}" />
  313. <Setter Property="Padding" Value="4,-1,0,0" />
  314. </Trigger>
  315. <Trigger Property="IsMouseOver" Value="true">
  316. <Setter TargetName="radioButtonBorder" Property="Background" Value="{StaticResource RadioButton.MouseOver.Background}" />
  317. <Setter TargetName="radioButtonBorder" Property="BorderBrush" Value="{StaticResource RadioButton.MouseOver.Border}" />
  318. <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource RadioButton.MouseOver.Glyph}" />
  319. </Trigger>
  320. <Trigger Property="IsEnabled" Value="false">
  321. <Setter TargetName="radioButtonBorder" Property="Background" Value="{StaticResource RadioButton.Disabled.Background}" />
  322. <Setter TargetName="radioButtonBorder" Property="BorderBrush" Value="{StaticResource RadioButton.Disabled.Border}" />
  323. <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource RadioButton.Disabled.Glyph}" />
  324. <Setter TargetName="root" Property="Border.Background">
  325. <Setter.Value>
  326. <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
  327. <GradientStop Offset="0.0" Color="White" />
  328. <GradientStop Offset="0.5" Color="#CFCFCF" />
  329. <GradientStop Offset="0.0" Color="White" />
  330. </LinearGradientBrush>
  331. </Setter.Value>
  332. </Setter>
  333. </Trigger>
  334. <Trigger Property="IsPressed" Value="true">
  335. <Setter TargetName="radioButtonBorder" Property="Background" Value="{StaticResource RadioButton.Pressed.Background}" />
  336. <Setter TargetName="radioButtonBorder" Property="BorderBrush" Value="{StaticResource RadioButton.Pressed.Border}" />
  337. <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource RadioButton.Pressed.Glyph}" />
  338. </Trigger>
  339. <Trigger Property="IsChecked" Value="true">
  340. <Setter TargetName="optionMark" Property="Opacity" Value="1" />
  341. <Setter TargetName="root" Property="Border.Background" Value="White" />
  342. </Trigger>
  343. <Trigger Property="IsChecked" Value="{x:Null}">
  344. <Setter TargetName="optionMark" Property="Opacity" Value="0.56" />
  345. </Trigger>
  346. </ControlTemplate.Triggers>
  347. </ControlTemplate>
  348. </Setter.Value>
  349. </Setter>
  350. </Style>
  351. <Style x:Key="LocationRadioBtnStyle" TargetType="{x:Type RadioButton}">
  352. <Setter Property="Background" Value="{StaticResource RadioButton.Static.Background}" />
  353. <Setter Property="BorderBrush" Value="{StaticResource RadioButton.Static.Border}" />
  354. <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
  355. <Setter Property="BorderThickness" Value="0" />
  356. <Setter Property="Width" Value="72" />
  357. <Setter Property="Height" Value="80" />
  358. <Setter Property="HorizontalContentAlignment" Value="Center" />
  359. <Setter Property="VerticalContentAlignment" Value="Center" />
  360. <Setter Property="Template">
  361. <Setter.Value>
  362. <ControlTemplate TargetType="{x:Type RadioButton}">
  363. <Grid
  364. x:Name="templateRoot"
  365. Background="Transparent"
  366. SnapsToDevicePixels="True">
  367. <Border
  368. x:Name="radioButtonBorder"
  369. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  370. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  371. Background="{TemplateBinding Background}"
  372. BorderBrush="{TemplateBinding BorderBrush}"
  373. BorderThickness="{TemplateBinding BorderThickness}">
  374. <Rectangle
  375. x:Name="optionMark"
  376. Width="{TemplateBinding Width}"
  377. Height="{TemplateBinding Height}"
  378. Opacity="0" />
  379. </Border>
  380. <ContentPresenter
  381. x:Name="contentPresenter"
  382. Margin="{TemplateBinding Padding}"
  383. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  384. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  385. Focusable="False"
  386. RecognizesAccessKey="True"
  387. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  388. </Grid>
  389. <ControlTemplate.Triggers>
  390. <Trigger Property="IsMouseOver" Value="true">
  391. <Setter TargetName="radioButtonBorder" Property="Background" Value="{StaticResource RadioButton.MouseOver.Background}" />
  392. <Setter TargetName="radioButtonBorder" Property="BorderBrush" Value="{StaticResource RadioButton.MouseOver.Border}" />
  393. <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource RadioButton.MouseOver.Glyph}" />
  394. </Trigger>
  395. <Trigger Property="IsEnabled" Value="false">
  396. <Setter TargetName="radioButtonBorder" Property="Background" Value="{StaticResource RadioButton.Disabled.Background}" />
  397. <Setter TargetName="radioButtonBorder" Property="BorderBrush" Value="{StaticResource RadioButton.Disabled.Border}" />
  398. <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource RadioButton.Disabled.Glyph}" />
  399. </Trigger>
  400. <Trigger Property="IsPressed" Value="true">
  401. <Setter TargetName="radioButtonBorder" Property="Background" Value="{StaticResource RadioButton.Pressed.Background}" />
  402. <Setter TargetName="radioButtonBorder" Property="BorderBrush" Value="{StaticResource RadioButton.Pressed.Border}" />
  403. <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource RadioButton.Pressed.Glyph}" />
  404. </Trigger>
  405. <Trigger Property="IsChecked" Value="true">
  406. <Setter TargetName="optionMark" Property="Opacity" Value="1" />
  407. <Setter TargetName="optionMark" Property="Fill" Value="Black" />
  408. </Trigger>
  409. <Trigger Property="IsChecked" Value="{x:Null}">
  410. <Setter TargetName="optionMark" Property="Opacity" Value="0.56" />
  411. </Trigger>
  412. </ControlTemplate.Triggers>
  413. </ControlTemplate>
  414. </Setter.Value>
  415. </Setter>
  416. </Style>
  417. <!-- 悬浮灰色背景单选按钮 -->
  418. <Style x:Key="GreyBgRadioBtnStyle" TargetType="{x:Type RadioButton}">
  419. <Setter Property="BorderThickness" Value="1" />
  420. <Setter Property="Foreground" Value="#252629" />
  421. <Setter Property="Template">
  422. <Setter.Value>
  423. <ControlTemplate TargetType="{x:Type RadioButton}">
  424. <Border
  425. x:Name="templateRoot"
  426. Background="{TemplateBinding Background}"
  427. CornerRadius="4"
  428. SnapsToDevicePixels="True">
  429. <ContentPresenter
  430. x:Name="contentPresenter"
  431. Grid.Column="1"
  432. Margin="{TemplateBinding Padding}"
  433. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  434. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  435. Focusable="False"
  436. RecognizesAccessKey="True"
  437. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  438. </Border>
  439. <ControlTemplate.Triggers>
  440. <Trigger Property="HasContent" Value="true">
  441. <Setter Property="FocusVisualStyle" Value="{StaticResource OptionMarkFocusVisual}" />
  442. <Setter Property="Padding" Value="4,-1,0,0" />
  443. </Trigger>
  444. <Trigger Property="IsMouseOver" Value="true">
  445. <Setter TargetName="templateRoot" Property="Background" Value="{StaticResource color.item-state.hov.bg}" />
  446. </Trigger>
  447. <Trigger Property="IsEnabled" Value="false">
  448. <Setter TargetName="templateRoot" Property="Opacity" Value="0.5" />
  449. </Trigger>
  450. <Trigger Property="IsPressed" Value="true" />
  451. <Trigger Property="IsChecked" Value="true">
  452. <Setter TargetName="templateRoot" Property="Background" Value="{StaticResource color.item-state.sel.bg.lv3}" />
  453. <Setter TargetName="templateRoot" Property="BorderBrush" Value="{StaticResource color.item-state.sel.border.lv3}" />
  454. <Setter Property="Foreground" Value="#616469" />
  455. <Setter TargetName="templateRoot" Property="BorderThickness" Value="1" />
  456. </Trigger>
  457. </ControlTemplate.Triggers>
  458. </ControlTemplate>
  459. </Setter.Value>
  460. </Setter>
  461. </Style>
  462. <Style x:Key="BatchButton" TargetType="{x:Type RadioButton}">
  463. <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
  464. <Setter Property="Background" Value="#F7F8FA" />
  465. <Setter Property="BorderThickness" Value="0" />
  466. <Setter Property="Cursor" Value="Hand" />
  467. <Setter Property="Template">
  468. <Setter.Value>
  469. <ControlTemplate TargetType="{x:Type RadioButton}">
  470. <ControlTemplate.Resources>
  471. <Storyboard x:Key="Storyboard1">
  472. <ColorAnimationUsingKeyFrames Storyboard.TargetName="bd" Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)">
  473. <EasingColorKeyFrame KeyTime="0" Value="White" />
  474. <EasingColorKeyFrame KeyTime="0:0:0.3" Value="#FFAFAFAF" />
  475. </ColorAnimationUsingKeyFrames>
  476. </Storyboard>
  477. <Storyboard x:Key="Storyboard2">
  478. <ColorAnimationUsingKeyFrames Storyboard.TargetName="bd" Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)">
  479. <EasingColorKeyFrame KeyTime="0" Value="#FFAFAFAF" />
  480. <EasingColorKeyFrame KeyTime="0:0:0.5" Value="#D3D3D3" />
  481. </ColorAnimationUsingKeyFrames>
  482. </Storyboard>
  483. </ControlTemplate.Resources>
  484. <BulletDecorator Background="Transparent">
  485. <Border
  486. x:Name="bd"
  487. HorizontalAlignment="Center"
  488. Background="White"
  489. CornerRadius="5">
  490. <Border.OpacityMask>
  491. <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
  492. <GradientStop Offset="0" Color="Black" />
  493. <GradientStop Offset="1" Color="White" />
  494. </LinearGradientBrush>
  495. </Border.OpacityMask>
  496. <ContentPresenter
  497. Width="{TemplateBinding Width}"
  498. Height="{TemplateBinding Height}"
  499. Margin="{TemplateBinding Padding}"
  500. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  501. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  502. RecognizesAccessKey="True" />
  503. </Border>
  504. </BulletDecorator>
  505. <ControlTemplate.Triggers>
  506. <Trigger Property="IsEnabled" Value="false">
  507. <Setter TargetName="bd" Property="Background" Value="gray" />
  508. </Trigger>
  509. <Trigger Property="IsChecked" Value="false">
  510. <Setter TargetName="bd" Property="Background" Value="{x:Null}" />
  511. </Trigger>
  512. <Trigger Property="IsChecked" Value="true">
  513. <Trigger.EnterActions>
  514. <BeginStoryboard x:Name="Storyboard2_BeginStoryboard" Storyboard="{StaticResource Storyboard2}" />
  515. </Trigger.EnterActions>
  516. <Setter TargetName="bd" Property="Background" Value="#FF606060" />
  517. </Trigger>
  518. <MultiTrigger>
  519. <MultiTrigger.EnterActions>
  520. <BeginStoryboard Storyboard="{StaticResource Storyboard1}" />
  521. </MultiTrigger.EnterActions>
  522. <MultiTrigger.Conditions>
  523. <Condition Property="IsMouseOver" Value="True" />
  524. <Condition Property="IsChecked" Value="False" />
  525. </MultiTrigger.Conditions>
  526. <Setter TargetName="bd" Property="Background" Value="Red" />
  527. </MultiTrigger>
  528. </ControlTemplate.Triggers>
  529. </ControlTemplate>
  530. </Setter.Value>
  531. </Setter>
  532. </Style>
  533. <!-- 底部工具栏的RadionButton StateBar Design Token -->
  534. <Style x:Key="StateBarRbt" TargetType="{x:Type RadioButton}">
  535. <Setter Property="Foreground" Value="{StaticResource color.icon.base.neutral.norm.lv1}" />
  536. <Setter Property="Background" Value="Transparent" />
  537. <Setter Property="FontSize" Value="18" />
  538. <Setter Property="Cursor" Value="Hand" />
  539. <Setter Property="Margin" Value="0,0,10,10" />
  540. <Setter Property="Height" Value="32" />
  541. <Setter Property="Template">
  542. <Setter.Value>
  543. <ControlTemplate TargetType="{x:Type RadioButton}">
  544. <Border
  545. x:Name="fore"
  546. Background="{TemplateBinding Background}"
  547. BorderThickness="0"
  548. CornerRadius="{StaticResource border-radius.4}">
  549. <ContentPresenter
  550. x:Name="content"
  551. HorizontalAlignment="Center"
  552. VerticalAlignment="Center"
  553. Content="{TemplateBinding Content}" />
  554. </Border>
  555. <ControlTemplate.Triggers>
  556. <Trigger Property="IsChecked" Value="true">
  557. <Setter TargetName="fore" Property="Background" Value="{StaticResource color.item-state.sel.bg.lv2}" />
  558. </Trigger>
  559. <Trigger Property="IsMouseOver" Value="True">
  560. <Setter TargetName="fore" Property="Background" Value="{StaticResource color.item-state.hov.bg}" />
  561. </Trigger>
  562. </ControlTemplate.Triggers>
  563. </ControlTemplate>
  564. </Setter.Value>
  565. </Setter>
  566. </Style>
  567. </ResourceDictionary>