RadioButtonStyle.xaml 29 KB

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