RadioButtonStyle.xaml 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469
  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="60" />
  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. <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="78" />
  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. <!-- 最近列表列表模式单选按钮 -->
  187. <Style x:Key="ListModeRadioBtnStyle" TargetType="{x:Type RadioButton}">
  188. <Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual}" />
  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="Template">
  193. <Setter.Value>
  194. <ControlTemplate TargetType="{x:Type RadioButton}">
  195. <Border
  196. x:Name="root"
  197. Background="#EEF2F3"
  198. CornerRadius="4">
  199. <Grid
  200. x:Name="templateRoot"
  201. HorizontalAlignment="Center"
  202. VerticalAlignment="Center"
  203. SnapsToDevicePixels="True">
  204. <Grid.ColumnDefinitions>
  205. <ColumnDefinition Width="Auto" />
  206. <ColumnDefinition Width="*" />
  207. </Grid.ColumnDefinitions>
  208. <Border
  209. x:Name="radioButtonBorder"
  210. Margin="1,1,2,1"
  211. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  212. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  213. Background="{TemplateBinding Background}"
  214. BorderBrush="{TemplateBinding BorderBrush}"
  215. BorderThickness="{TemplateBinding BorderThickness}"
  216. CornerRadius="100"
  217. Visibility="Collapsed">
  218. <Grid x:Name="markGrid" Margin="2">
  219. <Ellipse
  220. x:Name="optionMark"
  221. MinWidth="6"
  222. MinHeight="6"
  223. Fill="{StaticResource RadioButton.Static.Glyph}"
  224. Opacity="0" />
  225. </Grid>
  226. </Border>
  227. <ContentPresenter
  228. x:Name="contentPresenter"
  229. Grid.Column="1"
  230. Margin="{TemplateBinding Padding}"
  231. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  232. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  233. Focusable="False"
  234. RecognizesAccessKey="True"
  235. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  236. </Grid>
  237. </Border>
  238. <ControlTemplate.Triggers>
  239. <Trigger Property="HasContent" Value="true">
  240. <Setter Property="FocusVisualStyle" Value="{StaticResource OptionMarkFocusVisual}" />
  241. <Setter Property="Padding" Value="4,-1,0,0" />
  242. </Trigger>
  243. <Trigger Property="IsMouseOver" Value="true">
  244. <Setter TargetName="radioButtonBorder" Property="Background" Value="{StaticResource RadioButton.MouseOver.Background}" />
  245. <Setter TargetName="radioButtonBorder" Property="BorderBrush" Value="{StaticResource RadioButton.MouseOver.Border}" />
  246. <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource RadioButton.MouseOver.Glyph}" />
  247. </Trigger>
  248. <Trigger Property="IsEnabled" Value="false">
  249. <Setter TargetName="radioButtonBorder" Property="Background" Value="{StaticResource RadioButton.Disabled.Background}" />
  250. <Setter TargetName="radioButtonBorder" Property="BorderBrush" Value="{StaticResource RadioButton.Disabled.Border}" />
  251. <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource RadioButton.Disabled.Glyph}" />
  252. <Setter TargetName="root" Property="Border.Background">
  253. <Setter.Value>
  254. <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
  255. <GradientStop Offset="0.0" Color="White" />
  256. <GradientStop Offset="0.5" Color="#CFCFCF" />
  257. <GradientStop Offset="0.0" Color="White" />
  258. </LinearGradientBrush>
  259. </Setter.Value>
  260. </Setter>
  261. </Trigger>
  262. <Trigger Property="IsPressed" Value="true">
  263. <Setter TargetName="radioButtonBorder" Property="Background" Value="{StaticResource RadioButton.Pressed.Background}" />
  264. <Setter TargetName="radioButtonBorder" Property="BorderBrush" Value="{StaticResource RadioButton.Pressed.Border}" />
  265. <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource RadioButton.Pressed.Glyph}" />
  266. </Trigger>
  267. <Trigger Property="IsChecked" Value="true">
  268. <Setter TargetName="optionMark" Property="Opacity" Value="1" />
  269. <Setter TargetName="root" Property="Border.Background" Value="White" />
  270. </Trigger>
  271. <Trigger Property="IsChecked" Value="{x:Null}">
  272. <Setter Property="Opacity" TargetName="optionMark" Value="0.56"/>
  273. </Trigger>
  274. </ControlTemplate.Triggers>
  275. </ControlTemplate>
  276. </Setter.Value>
  277. </Setter>
  278. </Style>
  279. <Style x:Key="LocationRadioBtnStyle" TargetType="{x:Type RadioButton}">
  280. <Setter Property="Background" Value="{StaticResource RadioButton.Static.Background}" />
  281. <Setter Property="BorderBrush" Value="{StaticResource RadioButton.Static.Border}" />
  282. <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
  283. <Setter Property="BorderThickness" Value="0" />
  284. <Setter Property="Width" Value="72" />
  285. <Setter Property="Height" Value="80" />
  286. <Setter Property="HorizontalContentAlignment" Value="Center" />
  287. <Setter Property="VerticalContentAlignment" Value="Center" />
  288. <Setter Property="Template">
  289. <Setter.Value>
  290. <ControlTemplate TargetType="{x:Type RadioButton}">
  291. <Grid
  292. x:Name="templateRoot"
  293. Background="Transparent"
  294. SnapsToDevicePixels="True">
  295. <Border
  296. x:Name="radioButtonBorder"
  297. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  298. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  299. Background="{TemplateBinding Background}"
  300. BorderBrush="{TemplateBinding BorderBrush}"
  301. BorderThickness="{TemplateBinding BorderThickness}">
  302. <Rectangle
  303. x:Name="optionMark"
  304. Width="{TemplateBinding Width}"
  305. Height="{TemplateBinding Height}"
  306. Opacity="0" />
  307. </Border>
  308. <ContentPresenter
  309. x:Name="contentPresenter"
  310. Margin="{TemplateBinding Padding}"
  311. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  312. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  313. Focusable="False"
  314. RecognizesAccessKey="True"
  315. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  316. </Grid>
  317. <ControlTemplate.Triggers>
  318. <Trigger Property="IsMouseOver" Value="true">
  319. <Setter TargetName="radioButtonBorder" Property="Background" Value="{StaticResource RadioButton.MouseOver.Background}" />
  320. <Setter TargetName="radioButtonBorder" Property="BorderBrush" Value="{StaticResource RadioButton.MouseOver.Border}" />
  321. <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource RadioButton.MouseOver.Glyph}" />
  322. </Trigger>
  323. <Trigger Property="IsEnabled" Value="false">
  324. <Setter TargetName="radioButtonBorder" Property="Background" Value="{StaticResource RadioButton.Disabled.Background}" />
  325. <Setter TargetName="radioButtonBorder" Property="BorderBrush" Value="{StaticResource RadioButton.Disabled.Border}" />
  326. <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource RadioButton.Disabled.Glyph}" />
  327. </Trigger>
  328. <Trigger Property="IsPressed" Value="true">
  329. <Setter TargetName="radioButtonBorder" Property="Background" Value="{StaticResource RadioButton.Pressed.Background}" />
  330. <Setter TargetName="radioButtonBorder" Property="BorderBrush" Value="{StaticResource RadioButton.Pressed.Border}" />
  331. <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource RadioButton.Pressed.Glyph}" />
  332. </Trigger>
  333. <Trigger Property="IsChecked" Value="true">
  334. <Setter TargetName="optionMark" Property="Opacity" Value="1" />
  335. <Setter TargetName="optionMark" Property="Fill" Value="Black" />
  336. </Trigger>
  337. <Trigger Property="IsChecked" Value="{x:Null}">
  338. <Setter TargetName="optionMark" Property="Opacity" Value="0.56" />
  339. </Trigger>
  340. </ControlTemplate.Triggers>
  341. </ControlTemplate>
  342. </Setter.Value>
  343. </Setter>
  344. </Style>
  345. <!-- 悬浮灰色背景单选按钮 -->
  346. <Style x:Key="GreyBgRadioBtnStyle" TargetType="{x:Type RadioButton}">
  347. <Setter Property="BorderThickness" Value="1" />
  348. <Setter Property="Foreground" Value="#252629" />
  349. <Setter Property="Template">
  350. <Setter.Value>
  351. <ControlTemplate TargetType="{x:Type RadioButton}">
  352. <Border
  353. x:Name="templateRoot"
  354. Background="{TemplateBinding Background}"
  355. CornerRadius="4"
  356. SnapsToDevicePixels="True">
  357. <ContentPresenter
  358. x:Name="contentPresenter"
  359. Grid.Column="1"
  360. Margin="{TemplateBinding Padding}"
  361. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  362. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  363. Focusable="False"
  364. RecognizesAccessKey="True"
  365. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  366. </Border>
  367. <ControlTemplate.Triggers>
  368. <Trigger Property="HasContent" Value="true">
  369. <Setter Property="FocusVisualStyle" Value="{StaticResource OptionMarkFocusVisual}" />
  370. <Setter Property="Padding" Value="4,-1,0,0" />
  371. </Trigger>
  372. <Trigger Property="IsMouseOver" Value="true">
  373. <Setter TargetName="templateRoot" Property="Background" Value="#EDEEF0" />
  374. </Trigger>
  375. <Trigger Property="IsEnabled" Value="false">
  376. <Setter TargetName="templateRoot" Property="Opacity" Value="0.5" />
  377. </Trigger>
  378. <Trigger Property="IsPressed" Value="true" />
  379. <Trigger Property="IsChecked" Value="true">
  380. <Setter TargetName="templateRoot" Property="Background">
  381. <Setter.Value>
  382. <SolidColorBrush Opacity="0.6" Color="#CED0D4" />
  383. </Setter.Value>
  384. </Setter>
  385. <Setter TargetName="templateRoot" Property="BorderBrush" Value="#CED0D4" />
  386. <Setter Property="Foreground" Value="#616469" />
  387. <Setter TargetName="templateRoot" Property="BorderThickness" Value="1" />
  388. </Trigger>
  389. </ControlTemplate.Triggers>
  390. </ControlTemplate>
  391. </Setter.Value>
  392. </Setter>
  393. </Style>
  394. <Style x:Key="BatchButton" TargetType="{x:Type RadioButton}">
  395. <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
  396. <Setter Property="Background" Value="#F7F8FA"/>
  397. <Setter Property="BorderThickness" Value="0"/>
  398. <Setter Property="Cursor" Value="Hand"/>
  399. <Setter Property="Template">
  400. <Setter.Value>
  401. <ControlTemplate TargetType="{x:Type RadioButton}">
  402. <ControlTemplate.Resources>
  403. <Storyboard x:Key="Storyboard1">
  404. <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)" Storyboard.TargetName="bd">
  405. <EasingColorKeyFrame KeyTime="0" Value="White"/>
  406. <EasingColorKeyFrame KeyTime="0:0:0.3" Value="#FFAFAFAF"/>
  407. </ColorAnimationUsingKeyFrames>
  408. </Storyboard>
  409. <Storyboard x:Key="Storyboard2">
  410. <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)" Storyboard.TargetName="bd">
  411. <EasingColorKeyFrame KeyTime="0" Value="#FFAFAFAF"/>
  412. <EasingColorKeyFrame KeyTime="0:0:0.5" Value="#D3D3D3"/>
  413. </ColorAnimationUsingKeyFrames>
  414. </Storyboard>
  415. </ControlTemplate.Resources>
  416. <BulletDecorator Background="Transparent">
  417. <Border x:Name="bd" HorizontalAlignment="Center" Background="White" CornerRadius="5">
  418. <Border.OpacityMask>
  419. <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
  420. <GradientStop Color="Black" Offset="0"/>
  421. <GradientStop Color="White" Offset="1"/>
  422. </LinearGradientBrush>
  423. </Border.OpacityMask>
  424. <ContentPresenter Width="{TemplateBinding Width}" Height="{TemplateBinding Height}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
  425. </Border>
  426. </BulletDecorator>
  427. <ControlTemplate.Triggers>
  428. <Trigger Property="IsEnabled" Value="false">
  429. <Setter TargetName="bd" Property="Background" Value="gray" />
  430. </Trigger>
  431. <Trigger Property="IsChecked" Value="false">
  432. <Setter TargetName="bd" Property="Background" Value="{x:Null}" />
  433. </Trigger>
  434. <Trigger Property="IsChecked" Value="true">
  435. <Trigger.EnterActions>
  436. <BeginStoryboard x:Name="Storyboard2_BeginStoryboard" Storyboard="{StaticResource Storyboard2}"/>
  437. </Trigger.EnterActions>
  438. <Setter TargetName="bd" Property="Background" Value="#FF606060" />
  439. </Trigger>
  440. <MultiTrigger>
  441. <MultiTrigger.EnterActions>
  442. <BeginStoryboard Storyboard="{StaticResource Storyboard1}"/>
  443. </MultiTrigger.EnterActions>
  444. <MultiTrigger.Conditions>
  445. <Condition Property="IsMouseOver" Value="True"/>
  446. <Condition Property="IsChecked" Value="False"/>
  447. </MultiTrigger.Conditions>
  448. <Setter TargetName="bd" Property="Background" Value="Red" />
  449. </MultiTrigger>
  450. </ControlTemplate.Triggers>
  451. </ControlTemplate>
  452. </Setter.Value>
  453. </Setter>
  454. </Style>
  455. </ResourceDictionary>