RadioButtonStyle.xaml 40 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631
  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. <!--<ContentControl x:Name="content" Visibility="Collapsed" Foreground="{TemplateBinding Foreground}" />-->
  218. <ContentPresenter
  219. x:Name="contentPresenter"
  220. Margin="{TemplateBinding Padding}"
  221. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  222. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  223. Focusable="False"
  224. RecognizesAccessKey="True"
  225. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  226. </Grid>
  227. <ControlTemplate.Triggers>
  228. <Trigger Property="HasContent" Value="true">
  229. <Setter Property="FocusVisualStyle" Value="{x:Null}" />
  230. <Setter Property="Padding" Value="4,-1,0,0" />
  231. </Trigger>
  232. <Trigger Property="IsMouseOver" Value="true">
  233. <Setter TargetName="radioButtonBorder" Property="Background" Value="{StaticResource RadioButton.MouseOver.Background}" />
  234. <Setter TargetName="radioButtonBorder" Property="BorderBrush" Value="{StaticResource RadioButton.MouseOver.Border}" />
  235. <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource RadioButton.MouseOver.Glyph}" />
  236. </Trigger>
  237. <Trigger Property="IsEnabled" Value="false">
  238. <Setter TargetName="radioButtonBorder" Property="Background" Value="{StaticResource RadioButton.Disabled.Background}" />
  239. <Setter TargetName="radioButtonBorder" Property="BorderBrush" Value="{StaticResource RadioButton.Disabled.Border}" />
  240. <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource RadioButton.Disabled.Glyph}" />
  241. </Trigger>
  242. <Trigger Property="IsPressed" Value="true">
  243. <Setter TargetName="radioButtonBorder" Property="Background" Value="{StaticResource RadioButton.Pressed.Background}" />
  244. <Setter TargetName="radioButtonBorder" Property="BorderBrush" Value="{StaticResource RadioButton.Pressed.Border}" />
  245. <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource RadioButton.Pressed.Glyph}" />
  246. </Trigger>
  247. <Trigger Property="IsChecked" Value="true">
  248. <Setter TargetName="optionMark" Property="Opacity" Value="1" />
  249. <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource RadioButton.Pressed.Glyph}" />
  250. <!--<Setter TargetName="content" Property="Foreground" Value="Red" />-->
  251. </Trigger>
  252. <Trigger Property="IsChecked" Value="{x:Null}">
  253. <Setter TargetName="optionMark" Property="Opacity" Value="0.56" />
  254. <!--<Setter TargetName="content" Property="Foreground" Value="Red" />-->
  255. </Trigger>
  256. </ControlTemplate.Triggers>
  257. </ControlTemplate>
  258. </Setter.Value>
  259. </Setter>
  260. </Style>
  261. <!-- 最近列表列表模式单选按钮 -->
  262. <Style x:Key="ListModeRadioBtnStyle" TargetType="{x:Type RadioButton}">
  263. <Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual}" />
  264. <Setter Property="Background" Value="{StaticResource RadioButton.Static.Background}" />
  265. <Setter Property="BorderBrush" Value="{StaticResource RadioButton.Static.Border}" />
  266. <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
  267. <Setter Property="Template">
  268. <Setter.Value>
  269. <ControlTemplate TargetType="{x:Type RadioButton}">
  270. <Border
  271. x:Name="root"
  272. Background="#EEF2F3"
  273. CornerRadius="4">
  274. <Grid
  275. x:Name="templateRoot"
  276. HorizontalAlignment="Center"
  277. VerticalAlignment="Center"
  278. SnapsToDevicePixels="True">
  279. <Grid.ColumnDefinitions>
  280. <ColumnDefinition Width="Auto" />
  281. <ColumnDefinition Width="*" />
  282. </Grid.ColumnDefinitions>
  283. <Border
  284. x:Name="radioButtonBorder"
  285. Margin="1,1,2,1"
  286. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  287. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  288. Background="{TemplateBinding Background}"
  289. BorderBrush="{TemplateBinding BorderBrush}"
  290. BorderThickness="{TemplateBinding BorderThickness}"
  291. CornerRadius="100"
  292. Visibility="Collapsed">
  293. <Grid x:Name="markGrid" Margin="2">
  294. <Ellipse
  295. x:Name="optionMark"
  296. MinWidth="6"
  297. MinHeight="6"
  298. Fill="{StaticResource RadioButton.Static.Glyph}"
  299. Opacity="0" />
  300. </Grid>
  301. </Border>
  302. <ContentPresenter
  303. x:Name="contentPresenter"
  304. Grid.Column="1"
  305. Margin="{TemplateBinding Padding}"
  306. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  307. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  308. Focusable="False"
  309. RecognizesAccessKey="True"
  310. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  311. </Grid>
  312. </Border>
  313. <ControlTemplate.Triggers>
  314. <Trigger Property="HasContent" Value="true">
  315. <Setter Property="FocusVisualStyle" Value="{StaticResource OptionMarkFocusVisual}" />
  316. <Setter Property="Padding" Value="4,-1,0,0" />
  317. </Trigger>
  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. <Setter TargetName="root" Property="Border.Background">
  328. <Setter.Value>
  329. <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
  330. <GradientStop Offset="0.0" Color="White" />
  331. <GradientStop Offset="0.5" Color="#CFCFCF" />
  332. <GradientStop Offset="0.0" Color="White" />
  333. </LinearGradientBrush>
  334. </Setter.Value>
  335. </Setter>
  336. </Trigger>
  337. <Trigger Property="IsPressed" Value="true">
  338. <Setter TargetName="radioButtonBorder" Property="Background" Value="{StaticResource RadioButton.Pressed.Background}" />
  339. <Setter TargetName="radioButtonBorder" Property="BorderBrush" Value="{StaticResource RadioButton.Pressed.Border}" />
  340. <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource RadioButton.Pressed.Glyph}" />
  341. </Trigger>
  342. <Trigger Property="IsChecked" Value="true">
  343. <Setter TargetName="optionMark" Property="Opacity" Value="1" />
  344. <Setter TargetName="root" Property="Border.Background" Value="White" />
  345. </Trigger>
  346. <Trigger Property="IsChecked" Value="{x:Null}">
  347. <Setter TargetName="optionMark" Property="Opacity" Value="0.56" />
  348. </Trigger>
  349. </ControlTemplate.Triggers>
  350. </ControlTemplate>
  351. </Setter.Value>
  352. </Setter>
  353. </Style>
  354. <Style x:Key="LocationRadioBtnStyle" TargetType="{x:Type RadioButton}">
  355. <Setter Property="Background" Value="{StaticResource RadioButton.Static.Background}" />
  356. <Setter Property="BorderBrush" Value="{StaticResource RadioButton.Static.Border}" />
  357. <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
  358. <Setter Property="BorderThickness" Value="0" />
  359. <Setter Property="Width" Value="72" />
  360. <Setter Property="Height" Value="80" />
  361. <Setter Property="HorizontalContentAlignment" Value="Center" />
  362. <Setter Property="VerticalContentAlignment" Value="Center" />
  363. <Setter Property="Template">
  364. <Setter.Value>
  365. <ControlTemplate TargetType="{x:Type RadioButton}">
  366. <Grid
  367. x:Name="templateRoot"
  368. Background="Transparent"
  369. SnapsToDevicePixels="True">
  370. <Border
  371. x:Name="radioButtonBorder"
  372. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  373. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  374. Background="{TemplateBinding Background}"
  375. BorderBrush="{TemplateBinding BorderBrush}"
  376. BorderThickness="{TemplateBinding BorderThickness}">
  377. <Rectangle
  378. x:Name="optionMark"
  379. Width="{TemplateBinding Width}"
  380. Height="{TemplateBinding Height}"
  381. Opacity="0" />
  382. </Border>
  383. <ContentPresenter
  384. x:Name="contentPresenter"
  385. Margin="{TemplateBinding Padding}"
  386. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  387. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  388. Focusable="False"
  389. RecognizesAccessKey="True"
  390. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  391. </Grid>
  392. <ControlTemplate.Triggers>
  393. <Trigger Property="IsMouseOver" Value="true">
  394. <Setter TargetName="radioButtonBorder" Property="Background" Value="{StaticResource RadioButton.MouseOver.Background}" />
  395. <Setter TargetName="radioButtonBorder" Property="BorderBrush" Value="{StaticResource RadioButton.MouseOver.Border}" />
  396. <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource RadioButton.MouseOver.Glyph}" />
  397. </Trigger>
  398. <Trigger Property="IsEnabled" Value="false">
  399. <Setter TargetName="radioButtonBorder" Property="Background" Value="{StaticResource RadioButton.Disabled.Background}" />
  400. <Setter TargetName="radioButtonBorder" Property="BorderBrush" Value="{StaticResource RadioButton.Disabled.Border}" />
  401. <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource RadioButton.Disabled.Glyph}" />
  402. </Trigger>
  403. <Trigger Property="IsPressed" Value="true">
  404. <Setter TargetName="radioButtonBorder" Property="Background" Value="{StaticResource RadioButton.Pressed.Background}" />
  405. <Setter TargetName="radioButtonBorder" Property="BorderBrush" Value="{StaticResource RadioButton.Pressed.Border}" />
  406. <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource RadioButton.Pressed.Glyph}" />
  407. </Trigger>
  408. <Trigger Property="IsChecked" Value="true">
  409. <Setter TargetName="optionMark" Property="Opacity" Value="1" />
  410. <Setter TargetName="optionMark" Property="Fill" Value="Black" />
  411. </Trigger>
  412. <Trigger Property="IsChecked" Value="{x:Null}">
  413. <Setter TargetName="optionMark" Property="Opacity" Value="0.56" />
  414. </Trigger>
  415. </ControlTemplate.Triggers>
  416. </ControlTemplate>
  417. </Setter.Value>
  418. </Setter>
  419. </Style>
  420. <!-- 悬浮灰色背景单选按钮 -->
  421. <Style x:Key="GreyBgRadioBtnStyle" TargetType="{x:Type RadioButton}">
  422. <Setter Property="BorderThickness" Value="1" />
  423. <Setter Property="Foreground" Value="#252629" />
  424. <Setter Property="Template">
  425. <Setter.Value>
  426. <ControlTemplate TargetType="{x:Type RadioButton}">
  427. <Border
  428. x:Name="templateRoot"
  429. Background="{TemplateBinding Background}"
  430. CornerRadius="4"
  431. SnapsToDevicePixels="True">
  432. <ContentPresenter
  433. x:Name="contentPresenter"
  434. Grid.Column="1"
  435. Margin="{TemplateBinding Padding}"
  436. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  437. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  438. Focusable="False"
  439. RecognizesAccessKey="True"
  440. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  441. </Border>
  442. <ControlTemplate.Triggers>
  443. <Trigger Property="HasContent" Value="true">
  444. <Setter Property="FocusVisualStyle" Value="{StaticResource OptionMarkFocusVisual}" />
  445. <Setter Property="Padding" Value="4,-1,0,0" />
  446. </Trigger>
  447. <Trigger Property="IsMouseOver" Value="true">
  448. <Setter TargetName="templateRoot" Property="Background" Value="{StaticResource color.item-state.hov.bg}" />
  449. </Trigger>
  450. <Trigger Property="IsEnabled" Value="false">
  451. <Setter TargetName="templateRoot" Property="Opacity" Value="0.5" />
  452. </Trigger>
  453. <Trigger Property="IsPressed" Value="true" />
  454. <Trigger Property="IsChecked" Value="true">
  455. <Setter TargetName="templateRoot" Property="Background" Value="{StaticResource color.item-state.sel.bg.lv3}" />
  456. <Setter TargetName="templateRoot" Property="BorderBrush" Value="{StaticResource color.item-state.sel.border.lv3}" />
  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="GreyBgRadioBtnStyle2" TargetType="{x:Type RadioButton}">
  466. <Setter Property="FocusVisualStyle" Value="{x:Null}" />
  467. <Setter Property="BorderThickness" Value="1" />
  468. <Setter Property="Foreground" Value="#616469" />
  469. <Setter Property="Background" Value="Transparent" />
  470. <Setter Property="Template">
  471. <Setter.Value>
  472. <ControlTemplate TargetType="{x:Type RadioButton}">
  473. <Border
  474. x:Name="templateRoot"
  475. Background="{TemplateBinding Background}"
  476. CornerRadius="4"
  477. SnapsToDevicePixels="True">
  478. <ContentPresenter
  479. x:Name="contentPresenter"
  480. Grid.Column="1"
  481. Margin="{TemplateBinding Padding}"
  482. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  483. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  484. Focusable="False"
  485. RecognizesAccessKey="True"
  486. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  487. </Border>
  488. <ControlTemplate.Triggers>
  489. <Trigger Property="HasContent" Value="true">
  490. <Setter Property="FocusVisualStyle" Value="{x:Null}" />
  491. <!--<Setter Property="Padding" Value="6,6,0,0" />-->
  492. <Setter Property="HorizontalContentAlignment" Value="Center" />
  493. <Setter Property="VerticalContentAlignment" Value="Center" />
  494. </Trigger>
  495. <Trigger Property="IsMouseOver" Value="true">
  496. <Setter TargetName="templateRoot" Property="Background" Value="{StaticResource color.item-state.hov.bg}" />
  497. </Trigger>
  498. <Trigger Property="IsEnabled" Value="false">
  499. <Setter TargetName="templateRoot" Property="Opacity" Value="0.5" />
  500. </Trigger>
  501. <Trigger Property="IsPressed" Value="true" />
  502. <Trigger Property="IsChecked" Value="true">
  503. <Setter TargetName="templateRoot" Property="Background" Value="{StaticResource color.item-state.sel.bg.lv3}" />
  504. <Setter TargetName="templateRoot" Property="BorderBrush" Value="{StaticResource color.item-state.sel.border.lv3}" />
  505. <Setter Property="Foreground" Value="#252629" />
  506. <Setter TargetName="templateRoot" Property="BorderThickness" Value="1" />
  507. </Trigger>
  508. </ControlTemplate.Triggers>
  509. </ControlTemplate>
  510. </Setter.Value>
  511. </Setter>
  512. </Style>
  513. <Style x:Key="BatchButton" TargetType="{x:Type RadioButton}">
  514. <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
  515. <Setter Property="Background" Value="#F7F8FA" />
  516. <Setter Property="BorderThickness" Value="0" />
  517. <Setter Property="Cursor" Value="Hand" />
  518. <Setter Property="Template">
  519. <Setter.Value>
  520. <ControlTemplate TargetType="{x:Type RadioButton}">
  521. <ControlTemplate.Resources>
  522. <Storyboard x:Key="Storyboard1">
  523. <ColorAnimationUsingKeyFrames Storyboard.TargetName="bd" Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)">
  524. <EasingColorKeyFrame KeyTime="0" Value="White" />
  525. <EasingColorKeyFrame KeyTime="0:0:0.3" Value="#FFAFAFAF" />
  526. </ColorAnimationUsingKeyFrames>
  527. </Storyboard>
  528. <Storyboard x:Key="Storyboard2">
  529. <ColorAnimationUsingKeyFrames Storyboard.TargetName="bd" Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)">
  530. <EasingColorKeyFrame KeyTime="0" Value="#FFAFAFAF" />
  531. <EasingColorKeyFrame KeyTime="0:0:0.5" Value="#D3D3D3" />
  532. </ColorAnimationUsingKeyFrames>
  533. </Storyboard>
  534. </ControlTemplate.Resources>
  535. <BulletDecorator Background="Transparent">
  536. <Border
  537. x:Name="bd"
  538. HorizontalAlignment="Center"
  539. Background="White"
  540. CornerRadius="5">
  541. <Border.OpacityMask>
  542. <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
  543. <GradientStop Offset="0" Color="Black" />
  544. <GradientStop Offset="1" Color="White" />
  545. </LinearGradientBrush>
  546. </Border.OpacityMask>
  547. <ContentPresenter
  548. Width="{TemplateBinding Width}"
  549. Height="{TemplateBinding Height}"
  550. Margin="{TemplateBinding Padding}"
  551. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  552. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  553. RecognizesAccessKey="True" />
  554. </Border>
  555. </BulletDecorator>
  556. <ControlTemplate.Triggers>
  557. <Trigger Property="IsEnabled" Value="false">
  558. <Setter TargetName="bd" Property="Background" Value="gray" />
  559. </Trigger>
  560. <Trigger Property="IsChecked" Value="false">
  561. <Setter TargetName="bd" Property="Background" Value="{x:Null}" />
  562. </Trigger>
  563. <Trigger Property="IsChecked" Value="true">
  564. <Trigger.EnterActions>
  565. <BeginStoryboard x:Name="Storyboard2_BeginStoryboard" Storyboard="{StaticResource Storyboard2}" />
  566. </Trigger.EnterActions>
  567. <Setter TargetName="bd" Property="Background" Value="#FF606060" />
  568. </Trigger>
  569. <MultiTrigger>
  570. <MultiTrigger.EnterActions>
  571. <BeginStoryboard Storyboard="{StaticResource Storyboard1}" />
  572. </MultiTrigger.EnterActions>
  573. <MultiTrigger.Conditions>
  574. <Condition Property="IsMouseOver" Value="True" />
  575. <Condition Property="IsChecked" Value="False" />
  576. </MultiTrigger.Conditions>
  577. <Setter TargetName="bd" Property="Background" Value="Red" />
  578. </MultiTrigger>
  579. </ControlTemplate.Triggers>
  580. </ControlTemplate>
  581. </Setter.Value>
  582. </Setter>
  583. </Style>
  584. <!-- 底部工具栏的RadionButton StateBar Design Token -->
  585. <Style x:Key="StateBarRbt" TargetType="{x:Type RadioButton}">
  586. <Setter Property="Foreground" Value="{StaticResource color.icon.base.neutral.norm.lv1}" />
  587. <Setter Property="Background" Value="Transparent" />
  588. <Setter Property="FontSize" Value="18" />
  589. <Setter Property="Cursor" Value="Hand" />
  590. <Setter Property="Margin" Value="0,0,10,10" />
  591. <Setter Property="Height" Value="32" />
  592. <Setter Property="Template">
  593. <Setter.Value>
  594. <ControlTemplate TargetType="{x:Type RadioButton}">
  595. <Border
  596. x:Name="fore"
  597. Background="{TemplateBinding Background}"
  598. BorderThickness="0"
  599. CornerRadius="{StaticResource border-radius.4}">
  600. <ContentPresenter
  601. x:Name="content"
  602. HorizontalAlignment="Center"
  603. VerticalAlignment="Center"
  604. Content="{TemplateBinding Content}" />
  605. </Border>
  606. <ControlTemplate.Triggers>
  607. <Trigger Property="IsChecked" Value="true">
  608. <Setter TargetName="fore" Property="Background" Value="{StaticResource color.item-state.sel.bg.lv2}" />
  609. <Setter Property="Foreground" Value="{StaticResource color.icon.base.neutral.sel}" />
  610. </Trigger>
  611. <Trigger Property="IsMouseOver" Value="True">
  612. <Setter TargetName="fore" Property="Background" Value="{StaticResource color.item-state.hov.bg}" />
  613. </Trigger>
  614. </ControlTemplate.Triggers>
  615. </ControlTemplate>
  616. </Setter.Value>
  617. </Setter>
  618. </Style>
  619. </ResourceDictionary>