RadioButtonStyle.xaml 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547
  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}" CornerRadius="4">
  69. <Rectangle
  70. x:Name="optionMark"
  71. Width="{TemplateBinding Width}"
  72. Height="{TemplateBinding Height}"
  73. Opacity="0" />
  74. </Border>
  75. <ContentPresenter
  76. x:Name="contentPresenter"
  77. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  78. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  79. Focusable="False"
  80. RecognizesAccessKey="True"
  81. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  82. </Grid>
  83. <ControlTemplate.Triggers>
  84. <Trigger Property="HasContent" Value="true">
  85. <Setter Property="FocusVisualStyle" Value="{StaticResource OptionMarkFocusVisual}" />
  86. <Setter Property="Padding" Value="4,-1,0,0" />
  87. </Trigger>
  88. <Trigger Property="IsMouseOver" Value="true">
  89. <Setter TargetName="radioButtonBorder" Property="Background" Value="{StaticResource RadioButton.MouseOver.Background}" />
  90. <Setter TargetName="radioButtonBorder" Property="BorderBrush" Value="{StaticResource RadioButton.MouseOver.Border}" />
  91. <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource RadioButton.MouseOver.Glyph}" />
  92. </Trigger>
  93. <Trigger Property="IsEnabled" Value="false">
  94. <Setter TargetName="radioButtonBorder" Property="Background" Value="{StaticResource RadioButton.Disabled.Background}" />
  95. <Setter TargetName="radioButtonBorder" Property="BorderBrush" Value="{StaticResource RadioButton.Disabled.Border}" />
  96. <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource RadioButton.Disabled.Glyph}" />
  97. </Trigger>
  98. <Trigger Property="IsPressed" Value="true">
  99. <Setter TargetName="radioButtonBorder" Property="Background" Value="{StaticResource RadioButton.Pressed.Background}" />
  100. <Setter TargetName="radioButtonBorder" Property="BorderBrush" Value="{StaticResource RadioButton.Pressed.Border}" />
  101. <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource RadioButton.Pressed.Glyph}" />
  102. </Trigger>
  103. <Trigger Property="IsChecked" Value="true">
  104. <Setter TargetName="optionMark" Property="Opacity" Value="1" />
  105. <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource RadioButton.Pressed.Glyph}" />
  106. </Trigger>
  107. <Trigger Property="IsChecked" Value="{x:Null}">
  108. <Setter TargetName="optionMark" Property="Opacity" Value="0.56" />
  109. </Trigger>
  110. </ControlTemplate.Triggers>
  111. </ControlTemplate>
  112. </Setter.Value>
  113. </Setter>
  114. </Style>
  115. <Style x:Key="SplitModeViewRadioBtn" TargetType="{x:Type RadioButton}">
  116. <Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual}" />
  117. <Setter Property="Background" Value="{StaticResource RadioButton.Static.Background}" />
  118. <Setter Property="BorderBrush" Value="{StaticResource RadioButton.Static.Border}" />
  119. <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
  120. <Setter Property="BorderThickness" Value="0" />
  121. <Setter Property="Width" Value="76" />
  122. <Setter Property="Height" Value="80" />
  123. <Setter Property="HorizontalContentAlignment" Value="Center" />
  124. <Setter Property="VerticalContentAlignment" Value="Center" />
  125. <Setter Property="Template">
  126. <Setter.Value>
  127. <ControlTemplate TargetType="{x:Type RadioButton}">
  128. <Grid
  129. x:Name="templateRoot"
  130. Background="Transparent"
  131. SnapsToDevicePixels="True">
  132. <Border
  133. x:Name="radioButtonBorder"
  134. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  135. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  136. Background="{TemplateBinding Background}"
  137. BorderBrush="{TemplateBinding BorderBrush}"
  138. BorderThickness="{TemplateBinding BorderThickness}">
  139. <Rectangle
  140. x:Name="optionMark"
  141. Width="{TemplateBinding Width}"
  142. Height="{TemplateBinding Height}"
  143. Opacity="0" />
  144. </Border>
  145. <ContentPresenter
  146. x:Name="contentPresenter"
  147. Margin="{TemplateBinding Padding}"
  148. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  149. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  150. Focusable="False"
  151. RecognizesAccessKey="True"
  152. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  153. </Grid>
  154. <ControlTemplate.Triggers>
  155. <Trigger Property="HasContent" Value="true">
  156. <Setter Property="FocusVisualStyle" Value="{StaticResource OptionMarkFocusVisual}" />
  157. <Setter Property="Padding" Value="4,-1,0,0" />
  158. </Trigger>
  159. <Trigger Property="IsMouseOver" Value="true">
  160. <Setter TargetName="radioButtonBorder" Property="Background" Value="{StaticResource RadioButton.MouseOver.Background}" />
  161. <Setter TargetName="radioButtonBorder" Property="BorderBrush" Value="{StaticResource RadioButton.MouseOver.Border}" />
  162. <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource RadioButton.MouseOver.Glyph}" />
  163. </Trigger>
  164. <Trigger Property="IsEnabled" Value="false">
  165. <Setter TargetName="radioButtonBorder" Property="Background" Value="{StaticResource RadioButton.Disabled.Background}" />
  166. <Setter TargetName="radioButtonBorder" Property="BorderBrush" Value="{StaticResource RadioButton.Disabled.Border}" />
  167. <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource RadioButton.Disabled.Glyph}" />
  168. </Trigger>
  169. <Trigger Property="IsPressed" Value="true">
  170. <Setter TargetName="radioButtonBorder" Property="Background" Value="{StaticResource RadioButton.Pressed.Background}" />
  171. <Setter TargetName="radioButtonBorder" Property="BorderBrush" Value="{StaticResource RadioButton.Pressed.Border}" />
  172. <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource RadioButton.Pressed.Glyph}" />
  173. </Trigger>
  174. <Trigger Property="IsChecked" Value="true">
  175. <Setter TargetName="optionMark" Property="Opacity" Value="1" />
  176. <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource RadioButton.Pressed.Glyph}" />
  177. </Trigger>
  178. <Trigger Property="IsChecked" Value="{x:Null}">
  179. <Setter TargetName="optionMark" Property="Opacity" Value="0.56" />
  180. </Trigger>
  181. </ControlTemplate.Triggers>
  182. </ControlTemplate>
  183. </Setter.Value>
  184. </Setter>
  185. </Style>
  186. <Style x:Key="ViewModeViewRadioBtn" TargetType="{x:Type RadioButton}">
  187. <Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual}" />
  188. <Setter Property="Background" Value="{StaticResource RadioButton.Static.Background}" />
  189. <Setter Property="BorderBrush" Value="{StaticResource RadioButton.Static.Border}" />
  190. <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
  191. <Setter Property="BorderThickness" Value="0" />
  192. <Setter Property="Width" Value="72" />
  193. <Setter Property="Height" Value="80" />
  194. <Setter Property="HorizontalContentAlignment" Value="Center" />
  195. <Setter Property="VerticalContentAlignment" Value="Center" />
  196. <Setter Property="Template">
  197. <Setter.Value>
  198. <ControlTemplate TargetType="{x:Type RadioButton}">
  199. <Grid
  200. x:Name="templateRoot"
  201. Background="Transparent"
  202. SnapsToDevicePixels="True">
  203. <Border
  204. x:Name="radioButtonBorder"
  205. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  206. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  207. Background="{TemplateBinding Background}"
  208. BorderBrush="{TemplateBinding BorderBrush}"
  209. BorderThickness="{TemplateBinding BorderThickness}">
  210. <Rectangle
  211. x:Name="optionMark"
  212. Width="{TemplateBinding Width}"
  213. Height="{TemplateBinding Height}"
  214. Opacity="0" />
  215. </Border>
  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. </Grid>
  225. <ControlTemplate.Triggers>
  226. <Trigger Property="HasContent" Value="true">
  227. <Setter Property="FocusVisualStyle" Value="{StaticResource OptionMarkFocusVisual}" />
  228. <Setter Property="Padding" Value="4,-1,0,0" />
  229. </Trigger>
  230. <Trigger Property="IsMouseOver" Value="true">
  231. <Setter TargetName="radioButtonBorder" Property="Background" Value="{StaticResource RadioButton.MouseOver.Background}" />
  232. <Setter TargetName="radioButtonBorder" Property="BorderBrush" Value="{StaticResource RadioButton.MouseOver.Border}" />
  233. <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource RadioButton.MouseOver.Glyph}" />
  234. </Trigger>
  235. <Trigger Property="IsEnabled" Value="false">
  236. <Setter TargetName="radioButtonBorder" Property="Background" Value="{StaticResource RadioButton.Disabled.Background}" />
  237. <Setter TargetName="radioButtonBorder" Property="BorderBrush" Value="{StaticResource RadioButton.Disabled.Border}" />
  238. <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource RadioButton.Disabled.Glyph}" />
  239. </Trigger>
  240. <Trigger Property="IsPressed" Value="true">
  241. <Setter TargetName="radioButtonBorder" Property="Background" Value="{StaticResource RadioButton.Pressed.Background}" />
  242. <Setter TargetName="radioButtonBorder" Property="BorderBrush" Value="{StaticResource RadioButton.Pressed.Border}" />
  243. <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource RadioButton.Pressed.Glyph}" />
  244. </Trigger>
  245. <Trigger Property="IsChecked" Value="true">
  246. <Setter TargetName="optionMark" Property="Opacity" Value="1" />
  247. <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource RadioButton.Pressed.Glyph}" />
  248. </Trigger>
  249. <Trigger Property="IsChecked" Value="{x:Null}">
  250. <Setter TargetName="optionMark" Property="Opacity" Value="0.56" />
  251. </Trigger>
  252. </ControlTemplate.Triggers>
  253. </ControlTemplate>
  254. </Setter.Value>
  255. </Setter>
  256. </Style>
  257. <!-- 最近列表列表模式单选按钮 -->
  258. <Style x:Key="ListModeRadioBtnStyle" TargetType="{x:Type RadioButton}">
  259. <Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual}" />
  260. <Setter Property="Background" Value="{StaticResource RadioButton.Static.Background}" />
  261. <Setter Property="BorderBrush" Value="{StaticResource RadioButton.Static.Border}" />
  262. <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
  263. <Setter Property="Template">
  264. <Setter.Value>
  265. <ControlTemplate TargetType="{x:Type RadioButton}">
  266. <Border
  267. x:Name="root"
  268. Background="#EEF2F3"
  269. CornerRadius="4">
  270. <Grid
  271. x:Name="templateRoot"
  272. HorizontalAlignment="Center"
  273. VerticalAlignment="Center"
  274. SnapsToDevicePixels="True">
  275. <Grid.ColumnDefinitions>
  276. <ColumnDefinition Width="Auto" />
  277. <ColumnDefinition Width="*" />
  278. </Grid.ColumnDefinitions>
  279. <Border
  280. x:Name="radioButtonBorder"
  281. Margin="1,1,2,1"
  282. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  283. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  284. Background="{TemplateBinding Background}"
  285. BorderBrush="{TemplateBinding BorderBrush}"
  286. BorderThickness="{TemplateBinding BorderThickness}"
  287. CornerRadius="100"
  288. Visibility="Collapsed">
  289. <Grid x:Name="markGrid" Margin="2">
  290. <Ellipse
  291. x:Name="optionMark"
  292. MinWidth="6"
  293. MinHeight="6"
  294. Fill="{StaticResource RadioButton.Static.Glyph}"
  295. Opacity="0" />
  296. </Grid>
  297. </Border>
  298. <ContentPresenter
  299. x:Name="contentPresenter"
  300. Grid.Column="1"
  301. Margin="{TemplateBinding Padding}"
  302. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  303. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  304. Focusable="False"
  305. RecognizesAccessKey="True"
  306. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  307. </Grid>
  308. </Border>
  309. <ControlTemplate.Triggers>
  310. <Trigger Property="HasContent" Value="true">
  311. <Setter Property="FocusVisualStyle" Value="{StaticResource OptionMarkFocusVisual}" />
  312. <Setter Property="Padding" Value="4,-1,0,0" />
  313. </Trigger>
  314. <Trigger Property="IsMouseOver" Value="true">
  315. <Setter TargetName="radioButtonBorder" Property="Background" Value="{StaticResource RadioButton.MouseOver.Background}" />
  316. <Setter TargetName="radioButtonBorder" Property="BorderBrush" Value="{StaticResource RadioButton.MouseOver.Border}" />
  317. <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource RadioButton.MouseOver.Glyph}" />
  318. </Trigger>
  319. <Trigger Property="IsEnabled" Value="false">
  320. <Setter TargetName="radioButtonBorder" Property="Background" Value="{StaticResource RadioButton.Disabled.Background}" />
  321. <Setter TargetName="radioButtonBorder" Property="BorderBrush" Value="{StaticResource RadioButton.Disabled.Border}" />
  322. <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource RadioButton.Disabled.Glyph}" />
  323. <Setter TargetName="root" Property="Border.Background">
  324. <Setter.Value>
  325. <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
  326. <GradientStop Offset="0.0" Color="White" />
  327. <GradientStop Offset="0.5" Color="#CFCFCF" />
  328. <GradientStop Offset="0.0" Color="White" />
  329. </LinearGradientBrush>
  330. </Setter.Value>
  331. </Setter>
  332. </Trigger>
  333. <Trigger Property="IsPressed" Value="true">
  334. <Setter TargetName="radioButtonBorder" Property="Background" Value="{StaticResource RadioButton.Pressed.Background}" />
  335. <Setter TargetName="radioButtonBorder" Property="BorderBrush" Value="{StaticResource RadioButton.Pressed.Border}" />
  336. <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource RadioButton.Pressed.Glyph}" />
  337. </Trigger>
  338. <Trigger Property="IsChecked" Value="true">
  339. <Setter TargetName="optionMark" Property="Opacity" Value="1" />
  340. <Setter TargetName="root" Property="Border.Background" Value="White" />
  341. </Trigger>
  342. <Trigger Property="IsChecked" Value="{x:Null}">
  343. <Setter TargetName="optionMark" Property="Opacity" Value="0.56" />
  344. </Trigger>
  345. </ControlTemplate.Triggers>
  346. </ControlTemplate>
  347. </Setter.Value>
  348. </Setter>
  349. </Style>
  350. <Style x:Key="LocationRadioBtnStyle" TargetType="{x:Type RadioButton}">
  351. <Setter Property="Background" Value="{StaticResource RadioButton.Static.Background}" />
  352. <Setter Property="BorderBrush" Value="{StaticResource RadioButton.Static.Border}" />
  353. <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
  354. <Setter Property="BorderThickness" Value="0" />
  355. <Setter Property="Width" Value="72" />
  356. <Setter Property="Height" Value="80" />
  357. <Setter Property="HorizontalContentAlignment" Value="Center" />
  358. <Setter Property="VerticalContentAlignment" Value="Center" />
  359. <Setter Property="Template">
  360. <Setter.Value>
  361. <ControlTemplate TargetType="{x:Type RadioButton}">
  362. <Grid
  363. x:Name="templateRoot"
  364. Background="Transparent"
  365. SnapsToDevicePixels="True">
  366. <Border
  367. x:Name="radioButtonBorder"
  368. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  369. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  370. Background="{TemplateBinding Background}"
  371. BorderBrush="{TemplateBinding BorderBrush}"
  372. BorderThickness="{TemplateBinding BorderThickness}">
  373. <Rectangle
  374. x:Name="optionMark"
  375. Width="{TemplateBinding Width}"
  376. Height="{TemplateBinding Height}"
  377. Opacity="0" />
  378. </Border>
  379. <ContentPresenter
  380. x:Name="contentPresenter"
  381. Margin="{TemplateBinding Padding}"
  382. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  383. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  384. Focusable="False"
  385. RecognizesAccessKey="True"
  386. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  387. </Grid>
  388. <ControlTemplate.Triggers>
  389. <Trigger Property="IsMouseOver" Value="true">
  390. <Setter TargetName="radioButtonBorder" Property="Background" Value="{StaticResource RadioButton.MouseOver.Background}" />
  391. <Setter TargetName="radioButtonBorder" Property="BorderBrush" Value="{StaticResource RadioButton.MouseOver.Border}" />
  392. <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource RadioButton.MouseOver.Glyph}" />
  393. </Trigger>
  394. <Trigger Property="IsEnabled" Value="false">
  395. <Setter TargetName="radioButtonBorder" Property="Background" Value="{StaticResource RadioButton.Disabled.Background}" />
  396. <Setter TargetName="radioButtonBorder" Property="BorderBrush" Value="{StaticResource RadioButton.Disabled.Border}" />
  397. <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource RadioButton.Disabled.Glyph}" />
  398. </Trigger>
  399. <Trigger Property="IsPressed" Value="true">
  400. <Setter TargetName="radioButtonBorder" Property="Background" Value="{StaticResource RadioButton.Pressed.Background}" />
  401. <Setter TargetName="radioButtonBorder" Property="BorderBrush" Value="{StaticResource RadioButton.Pressed.Border}" />
  402. <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource RadioButton.Pressed.Glyph}" />
  403. </Trigger>
  404. <Trigger Property="IsChecked" Value="true">
  405. <Setter TargetName="optionMark" Property="Opacity" Value="1" />
  406. <Setter TargetName="optionMark" Property="Fill" Value="Black" />
  407. </Trigger>
  408. <Trigger Property="IsChecked" Value="{x:Null}">
  409. <Setter TargetName="optionMark" Property="Opacity" Value="0.56" />
  410. </Trigger>
  411. </ControlTemplate.Triggers>
  412. </ControlTemplate>
  413. </Setter.Value>
  414. </Setter>
  415. </Style>
  416. <!-- 悬浮灰色背景单选按钮 -->
  417. <Style x:Key="GreyBgRadioBtnStyle" TargetType="{x:Type RadioButton}">
  418. <Setter Property="BorderThickness" Value="1" />
  419. <Setter Property="Foreground" Value="#252629" />
  420. <Setter Property="Template">
  421. <Setter.Value>
  422. <ControlTemplate TargetType="{x:Type RadioButton}">
  423. <Border
  424. x:Name="templateRoot"
  425. Background="{TemplateBinding Background}"
  426. CornerRadius="4"
  427. SnapsToDevicePixels="True">
  428. <ContentPresenter
  429. x:Name="contentPresenter"
  430. Grid.Column="1"
  431. Margin="{TemplateBinding Padding}"
  432. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  433. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  434. Focusable="False"
  435. RecognizesAccessKey="True"
  436. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  437. </Border>
  438. <ControlTemplate.Triggers>
  439. <Trigger Property="HasContent" Value="true">
  440. <Setter Property="FocusVisualStyle" Value="{StaticResource OptionMarkFocusVisual}" />
  441. <Setter Property="Padding" Value="4,-1,0,0" />
  442. </Trigger>
  443. <Trigger Property="IsMouseOver" Value="true">
  444. <Setter TargetName="templateRoot" Property="Background" Value="#EDEEF0" />
  445. </Trigger>
  446. <Trigger Property="IsEnabled" Value="false">
  447. <Setter TargetName="templateRoot" Property="Opacity" Value="0.5" />
  448. </Trigger>
  449. <Trigger Property="IsPressed" Value="true" />
  450. <Trigger Property="IsChecked" Value="true">
  451. <Setter TargetName="templateRoot" Property="Background">
  452. <Setter.Value>
  453. <SolidColorBrush Opacity="0.6" Color="#CED0D4" />
  454. </Setter.Value>
  455. </Setter>
  456. <Setter TargetName="templateRoot" Property="BorderBrush" Value="#CED0D4" />
  457. <Setter Property="Foreground" Value="#616469" />
  458. <Setter TargetName="templateRoot" Property="BorderThickness" Value="1" />
  459. </Trigger>
  460. </ControlTemplate.Triggers>
  461. </ControlTemplate>
  462. </Setter.Value>
  463. </Setter>
  464. </Style>
  465. <Style x:Key="BatchButton" TargetType="{x:Type RadioButton}">
  466. <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
  467. <Setter Property="Background" Value="#F7F8FA" />
  468. <Setter Property="BorderThickness" Value="0" />
  469. <Setter Property="Cursor" Value="Hand" />
  470. <Setter Property="Template">
  471. <Setter.Value>
  472. <ControlTemplate TargetType="{x:Type RadioButton}">
  473. <ControlTemplate.Resources>
  474. <Storyboard x:Key="Storyboard1">
  475. <ColorAnimationUsingKeyFrames Storyboard.TargetName="bd" Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)">
  476. <EasingColorKeyFrame KeyTime="0" Value="White" />
  477. <EasingColorKeyFrame KeyTime="0:0:0.3" Value="#FFAFAFAF" />
  478. </ColorAnimationUsingKeyFrames>
  479. </Storyboard>
  480. <Storyboard x:Key="Storyboard2">
  481. <ColorAnimationUsingKeyFrames Storyboard.TargetName="bd" Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)">
  482. <EasingColorKeyFrame KeyTime="0" Value="#FFAFAFAF" />
  483. <EasingColorKeyFrame KeyTime="0:0:0.5" Value="#D3D3D3" />
  484. </ColorAnimationUsingKeyFrames>
  485. </Storyboard>
  486. </ControlTemplate.Resources>
  487. <BulletDecorator Background="Transparent">
  488. <Border
  489. x:Name="bd"
  490. HorizontalAlignment="Center"
  491. Background="White"
  492. CornerRadius="5">
  493. <Border.OpacityMask>
  494. <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
  495. <GradientStop Offset="0" Color="Black" />
  496. <GradientStop Offset="1" Color="White" />
  497. </LinearGradientBrush>
  498. </Border.OpacityMask>
  499. <ContentPresenter
  500. Width="{TemplateBinding Width}"
  501. Height="{TemplateBinding Height}"
  502. Margin="{TemplateBinding Padding}"
  503. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  504. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  505. RecognizesAccessKey="True" />
  506. </Border>
  507. </BulletDecorator>
  508. <ControlTemplate.Triggers>
  509. <Trigger Property="IsEnabled" Value="false">
  510. <Setter TargetName="bd" Property="Background" Value="gray" />
  511. </Trigger>
  512. <Trigger Property="IsChecked" Value="false">
  513. <Setter TargetName="bd" Property="Background" Value="{x:Null}" />
  514. </Trigger>
  515. <Trigger Property="IsChecked" Value="true">
  516. <Trigger.EnterActions>
  517. <BeginStoryboard x:Name="Storyboard2_BeginStoryboard" Storyboard="{StaticResource Storyboard2}" />
  518. </Trigger.EnterActions>
  519. <Setter TargetName="bd" Property="Background" Value="#FF606060" />
  520. </Trigger>
  521. <MultiTrigger>
  522. <MultiTrigger.EnterActions>
  523. <BeginStoryboard Storyboard="{StaticResource Storyboard1}" />
  524. </MultiTrigger.EnterActions>
  525. <MultiTrigger.Conditions>
  526. <Condition Property="IsMouseOver" Value="True" />
  527. <Condition Property="IsChecked" Value="False" />
  528. </MultiTrigger.Conditions>
  529. <Setter TargetName="bd" Property="Background" Value="Red" />
  530. </MultiTrigger>
  531. </ControlTemplate.Triggers>
  532. </ControlTemplate>
  533. </Setter.Value>
  534. </Setter>
  535. </Style>
  536. </ResourceDictionary>