RadioButtonStyle.xaml 47 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760
  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="Transparent" />
  265. <Setter Property="BorderBrush" Value="{StaticResource RadioButton.Static.Border}" />
  266. <Setter Property="Foreground" Value="{StaticResource color.icon.base.neutral.norm.lv1}" />
  267. <Setter Property="Padding" Value="0" />
  268. <Setter Property="Template">
  269. <Setter.Value>
  270. <ControlTemplate TargetType="{x:Type RadioButton}">
  271. <Border
  272. x:Name="root"
  273. Background="Transparent"
  274. CornerRadius="4">
  275. <Grid
  276. x:Name="templateRoot"
  277. HorizontalAlignment="Center"
  278. VerticalAlignment="Center"
  279. SnapsToDevicePixels="True">
  280. <Grid.ColumnDefinitions>
  281. <ColumnDefinition Width="Auto" />
  282. <ColumnDefinition Width="*" />
  283. </Grid.ColumnDefinitions>
  284. <Border
  285. x:Name="radioButtonBorder"
  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
  294. x:Name="markGrid"
  295. Margin="2"
  296. Visibility="Collapsed">
  297. <Ellipse
  298. x:Name="optionMark"
  299. MinWidth="6"
  300. MinHeight="6"
  301. Fill="{StaticResource RadioButton.Static.Glyph}"
  302. Opacity="0" />
  303. </Grid>
  304. </Border>
  305. <ContentPresenter
  306. x:Name="contentPresenter"
  307. Grid.Column="1"
  308. Margin="{TemplateBinding Padding}"
  309. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  310. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  311. Focusable="False"
  312. RecognizesAccessKey="True"
  313. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  314. </Grid>
  315. </Border>
  316. <ControlTemplate.Triggers>
  317. <Trigger Property="HasContent" Value="true">
  318. <Setter Property="FocusVisualStyle" Value="{StaticResource OptionMarkFocusVisual}" />
  319. <Setter Property="Padding" Value="4,-1,0,0" />
  320. </Trigger>
  321. <Trigger Property="IsMouseOver" Value="true">
  322. <Setter TargetName="radioButtonBorder" Property="Background" Value="{StaticResource RadioButton.MouseOver.Background}" />
  323. <Setter TargetName="radioButtonBorder" Property="BorderBrush" Value="{StaticResource RadioButton.MouseOver.Border}" />
  324. <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource RadioButton.MouseOver.Glyph}" />
  325. </Trigger>
  326. <Trigger Property="IsEnabled" Value="false">
  327. <Setter TargetName="radioButtonBorder" Property="Background" Value="{StaticResource RadioButton.Disabled.Background}" />
  328. <Setter TargetName="radioButtonBorder" Property="BorderBrush" Value="{StaticResource RadioButton.Disabled.Border}" />
  329. <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource RadioButton.Disabled.Glyph}" />
  330. <Setter TargetName="root" Property="Border.Background">
  331. <Setter.Value>
  332. <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
  333. <GradientStop Offset="0.0" Color="White" />
  334. <GradientStop Offset="0.5" Color="#CFCFCF" />
  335. <GradientStop Offset="0.0" Color="White" />
  336. </LinearGradientBrush>
  337. </Setter.Value>
  338. </Setter>
  339. </Trigger>
  340. <Trigger Property="IsPressed" Value="true">
  341. <Setter TargetName="radioButtonBorder" Property="Background" Value="{StaticResource RadioButton.Pressed.Background}" />
  342. <Setter TargetName="radioButtonBorder" Property="BorderBrush" Value="{StaticResource RadioButton.Pressed.Border}" />
  343. <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource RadioButton.Pressed.Glyph}" />
  344. </Trigger>
  345. <Trigger Property="IsChecked" Value="true">
  346. <Setter TargetName="optionMark" Property="Opacity" Value="1" />
  347. <Setter TargetName="root" Property="Border.Background" Value="{StaticResource color.sys.layout.anti}" />
  348. <Setter Property="Foreground" Value="{StaticResource color.icon.base.neutral.sel}" />
  349. </Trigger>
  350. <Trigger Property="IsChecked" Value="{x:Null}">
  351. <Setter TargetName="optionMark" Property="Opacity" Value="0.56" />
  352. </Trigger>
  353. </ControlTemplate.Triggers>
  354. </ControlTemplate>
  355. </Setter.Value>
  356. </Setter>
  357. </Style>
  358. <Style x:Key="LocationRadioBtnStyle" TargetType="{x:Type RadioButton}">
  359. <Setter Property="Background" Value="{StaticResource RadioButton.Static.Background}" />
  360. <Setter Property="BorderBrush" Value="{StaticResource RadioButton.Static.Border}" />
  361. <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
  362. <Setter Property="BorderThickness" Value="0" />
  363. <Setter Property="Width" Value="72" />
  364. <Setter Property="Height" Value="80" />
  365. <Setter Property="HorizontalContentAlignment" Value="Center" />
  366. <Setter Property="VerticalContentAlignment" Value="Center" />
  367. <Setter Property="Template">
  368. <Setter.Value>
  369. <ControlTemplate TargetType="{x:Type RadioButton}">
  370. <Grid
  371. x:Name="templateRoot"
  372. Background="Transparent"
  373. SnapsToDevicePixels="True">
  374. <Border
  375. x:Name="radioButtonBorder"
  376. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  377. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  378. Background="{TemplateBinding Background}"
  379. BorderBrush="{TemplateBinding BorderBrush}"
  380. BorderThickness="{TemplateBinding BorderThickness}">
  381. <Rectangle
  382. x:Name="optionMark"
  383. Width="{TemplateBinding Width}"
  384. Height="{TemplateBinding Height}"
  385. Opacity="0" />
  386. </Border>
  387. <ContentPresenter
  388. x:Name="contentPresenter"
  389. Margin="{TemplateBinding Padding}"
  390. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  391. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  392. Focusable="False"
  393. RecognizesAccessKey="True"
  394. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  395. </Grid>
  396. <ControlTemplate.Triggers>
  397. <Trigger Property="IsMouseOver" Value="true">
  398. <Setter TargetName="radioButtonBorder" Property="Background" Value="{StaticResource RadioButton.MouseOver.Background}" />
  399. <Setter TargetName="radioButtonBorder" Property="BorderBrush" Value="{StaticResource RadioButton.MouseOver.Border}" />
  400. <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource RadioButton.MouseOver.Glyph}" />
  401. </Trigger>
  402. <Trigger Property="IsEnabled" Value="false">
  403. <Setter TargetName="radioButtonBorder" Property="Background" Value="{StaticResource RadioButton.Disabled.Background}" />
  404. <Setter TargetName="radioButtonBorder" Property="BorderBrush" Value="{StaticResource RadioButton.Disabled.Border}" />
  405. <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource RadioButton.Disabled.Glyph}" />
  406. </Trigger>
  407. <Trigger Property="IsPressed" Value="true">
  408. <Setter TargetName="radioButtonBorder" Property="Background" Value="{StaticResource RadioButton.Pressed.Background}" />
  409. <Setter TargetName="radioButtonBorder" Property="BorderBrush" Value="{StaticResource RadioButton.Pressed.Border}" />
  410. <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource RadioButton.Pressed.Glyph}" />
  411. </Trigger>
  412. <Trigger Property="IsChecked" Value="true">
  413. <Setter TargetName="optionMark" Property="Opacity" Value="1" />
  414. <Setter TargetName="optionMark" Property="Fill" Value="Black" />
  415. </Trigger>
  416. <Trigger Property="IsChecked" Value="{x:Null}">
  417. <Setter TargetName="optionMark" Property="Opacity" Value="0.56" />
  418. </Trigger>
  419. </ControlTemplate.Triggers>
  420. </ControlTemplate>
  421. </Setter.Value>
  422. </Setter>
  423. </Style>
  424. <!-- 右键菜单,单选按钮 -->
  425. <Style x:Key="MenuRadioBtnStyle" TargetType="{x:Type RadioButton}">
  426. <Setter Property="BorderThickness" Value="1" />
  427. <Setter Property="Background" Value="Transparent" />
  428. <Setter Property="Template">
  429. <Setter.Value>
  430. <ControlTemplate TargetType="{x:Type RadioButton}">
  431. <Border
  432. x:Name="templateRoot"
  433. Background="{TemplateBinding Background}"
  434. CornerRadius="0"
  435. SnapsToDevicePixels="True">
  436. <Grid>
  437. <Grid.ColumnDefinitions>
  438. <ColumnDefinition Width="20" />
  439. <ColumnDefinition />
  440. </Grid.ColumnDefinitions>
  441. <Path
  442. x:Name="pathIcon"
  443. Data="M11.1144 1.57308L5.71438 9.28737C5.58464 9.47271 5.37817 9.58958 5.15248 9.60543C4.9268 9.62128 4.70603 9.5344 4.55166 9.36901L0.95166 5.51187L2.04824 4.48839L5.01649 7.66866L9.88553 0.712891L11.1144 1.57308Z"
  444. Fill="{StaticResource color.icon.base.neutral.norm.lv1}"
  445. Visibility="Collapsed" />
  446. <ContentPresenter
  447. x:Name="contentPresenter"
  448. Grid.Column="1"
  449. Margin="{TemplateBinding Padding}"
  450. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  451. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  452. Focusable="False"
  453. RecognizesAccessKey="True"
  454. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  455. </Grid>
  456. </Border>
  457. <ControlTemplate.Triggers>
  458. <Trigger Property="HasContent" Value="true">
  459. <Setter Property="FocusVisualStyle" Value="{StaticResource OptionMarkFocusVisual}" />
  460. <Setter Property="Padding" Value="4,-1,0,0" />
  461. </Trigger>
  462. <Trigger Property="IsMouseOver" Value="true" />
  463. <Trigger Property="IsEnabled" Value="false">
  464. <Setter TargetName="contentPresenter" Property="Opacity" Value="0.5" />
  465. </Trigger>
  466. <Trigger Property="IsPressed" Value="true" />
  467. <Trigger Property="IsChecked" Value="true">
  468. <Setter TargetName="pathIcon" Property="Visibility" Value="Visible" />
  469. </Trigger>
  470. </ControlTemplate.Triggers>
  471. </ControlTemplate>
  472. </Setter.Value>
  473. </Setter>
  474. </Style>
  475. <!-- 悬浮灰色背景单选按钮 -->
  476. <Style x:Key="GreyBgRadioBtnStyle" TargetType="{x:Type RadioButton}">
  477. <Setter Property="BorderThickness" Value="1" />
  478. <Setter Property="Foreground" Value="#252629" />
  479. <Setter Property="Template">
  480. <Setter.Value>
  481. <ControlTemplate TargetType="{x:Type RadioButton}">
  482. <Border
  483. x:Name="templateRoot"
  484. Background="{TemplateBinding Background}"
  485. CornerRadius="4"
  486. SnapsToDevicePixels="True">
  487. <ContentPresenter
  488. x:Name="contentPresenter"
  489. Grid.Column="1"
  490. Margin="{TemplateBinding Padding}"
  491. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  492. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  493. Focusable="False"
  494. RecognizesAccessKey="True"
  495. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  496. </Border>
  497. <ControlTemplate.Triggers>
  498. <Trigger Property="HasContent" Value="true">
  499. <Setter Property="FocusVisualStyle" Value="{StaticResource OptionMarkFocusVisual}" />
  500. <Setter Property="Padding" Value="4,-1,0,0" />
  501. </Trigger>
  502. <Trigger Property="IsMouseOver" Value="true">
  503. <Setter TargetName="templateRoot" Property="Background" Value="{StaticResource color.item-state.hov.bg}" />
  504. </Trigger>
  505. <Trigger Property="IsEnabled" Value="false">
  506. <Setter TargetName="templateRoot" Property="Opacity" Value="0.5" />
  507. </Trigger>
  508. <Trigger Property="IsPressed" Value="true" />
  509. <Trigger Property="IsChecked" Value="true">
  510. <Setter TargetName="templateRoot" Property="Background" Value="{StaticResource color.item-state.sel.bg.lv3}" />
  511. <Setter TargetName="templateRoot" Property="BorderBrush" Value="{StaticResource color.item-state.sel.border.lv3}" />
  512. <Setter Property="Foreground" Value="#616469" />
  513. <Setter TargetName="templateRoot" Property="BorderThickness" Value="1" />
  514. </Trigger>
  515. </ControlTemplate.Triggers>
  516. </ControlTemplate>
  517. </Setter.Value>
  518. </Setter>
  519. </Style>
  520. <Style x:Key="GreyBgRadioBtnStyle2" TargetType="{x:Type RadioButton}">
  521. <Setter Property="FocusVisualStyle" Value="{x:Null}" />
  522. <Setter Property="BorderThickness" Value="1" />
  523. <Setter Property="Foreground" Value="#616469" />
  524. <Setter Property="Background" Value="Transparent" />
  525. <Setter Property="Template">
  526. <Setter.Value>
  527. <ControlTemplate TargetType="{x:Type RadioButton}">
  528. <Border
  529. x:Name="templateRoot"
  530. Background="{TemplateBinding Background}"
  531. CornerRadius="4"
  532. SnapsToDevicePixels="True">
  533. <ContentPresenter
  534. x:Name="contentPresenter"
  535. Grid.Column="1"
  536. Margin="{TemplateBinding Padding}"
  537. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  538. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  539. Focusable="False"
  540. RecognizesAccessKey="True"
  541. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  542. </Border>
  543. <ControlTemplate.Triggers>
  544. <Trigger Property="HasContent" Value="true">
  545. <Setter Property="FocusVisualStyle" Value="{x:Null}" />
  546. <!--<Setter Property="Padding" Value="6,6,0,0" />-->
  547. <Setter Property="HorizontalContentAlignment" Value="Center" />
  548. <Setter Property="VerticalContentAlignment" Value="Center" />
  549. </Trigger>
  550. <Trigger Property="IsMouseOver" Value="true">
  551. <Setter TargetName="templateRoot" Property="Background" Value="{StaticResource color.item-state.hov.bg}" />
  552. </Trigger>
  553. <Trigger Property="IsEnabled" Value="false">
  554. <Setter TargetName="templateRoot" Property="Opacity" Value="0.5" />
  555. </Trigger>
  556. <Trigger Property="IsPressed" Value="true" />
  557. <Trigger Property="IsChecked" Value="true">
  558. <Setter TargetName="templateRoot" Property="Background" Value="{StaticResource color.item-state.sel.bg.lv3}" />
  559. <Setter TargetName="templateRoot" Property="BorderBrush" Value="{StaticResource color.item-state.sel.border.lv3}" />
  560. <Setter Property="Foreground" Value="#252629" />
  561. <Setter TargetName="templateRoot" Property="BorderThickness" Value="1" />
  562. </Trigger>
  563. </ControlTemplate.Triggers>
  564. </ControlTemplate>
  565. </Setter.Value>
  566. </Setter>
  567. </Style>
  568. <Style x:Key="BatchButton" TargetType="{x:Type RadioButton}">
  569. <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
  570. <Setter Property="Background" Value="#F7F8FA" />
  571. <Setter Property="BorderThickness" Value="0" />
  572. <Setter Property="Cursor" Value="Hand" />
  573. <Setter Property="Template">
  574. <Setter.Value>
  575. <ControlTemplate TargetType="{x:Type RadioButton}">
  576. <ControlTemplate.Resources>
  577. <Storyboard x:Key="Storyboard1">
  578. <ColorAnimationUsingKeyFrames Storyboard.TargetName="bd" Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)">
  579. <EasingColorKeyFrame KeyTime="0" Value="White" />
  580. <EasingColorKeyFrame KeyTime="0:0:0.3" Value="#FFAFAFAF" />
  581. </ColorAnimationUsingKeyFrames>
  582. </Storyboard>
  583. <Storyboard x:Key="Storyboard2">
  584. <ColorAnimationUsingKeyFrames Storyboard.TargetName="bd" Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)">
  585. <EasingColorKeyFrame KeyTime="0" Value="#FFAFAFAF" />
  586. <EasingColorKeyFrame KeyTime="0:0:0.5" Value="#D3D3D3" />
  587. </ColorAnimationUsingKeyFrames>
  588. </Storyboard>
  589. </ControlTemplate.Resources>
  590. <BulletDecorator Background="Transparent">
  591. <Border
  592. x:Name="bd"
  593. HorizontalAlignment="Center"
  594. Background="White"
  595. CornerRadius="5">
  596. <Border.OpacityMask>
  597. <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
  598. <GradientStop Offset="0" Color="Black" />
  599. <GradientStop Offset="1" Color="White" />
  600. </LinearGradientBrush>
  601. </Border.OpacityMask>
  602. <ContentPresenter
  603. Width="{TemplateBinding Width}"
  604. Height="{TemplateBinding Height}"
  605. Margin="{TemplateBinding Padding}"
  606. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  607. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  608. RecognizesAccessKey="True" />
  609. </Border>
  610. </BulletDecorator>
  611. <ControlTemplate.Triggers>
  612. <Trigger Property="IsEnabled" Value="false">
  613. <Setter TargetName="bd" Property="Background" Value="gray" />
  614. </Trigger>
  615. <Trigger Property="IsChecked" Value="false">
  616. <Setter TargetName="bd" Property="Background" Value="{x:Null}" />
  617. </Trigger>
  618. <Trigger Property="IsChecked" Value="true">
  619. <Trigger.EnterActions>
  620. <BeginStoryboard x:Name="Storyboard2_BeginStoryboard" Storyboard="{StaticResource Storyboard2}" />
  621. </Trigger.EnterActions>
  622. <Setter TargetName="bd" Property="Background" Value="#FF606060" />
  623. </Trigger>
  624. <MultiTrigger>
  625. <MultiTrigger.EnterActions>
  626. <BeginStoryboard Storyboard="{StaticResource Storyboard1}" />
  627. </MultiTrigger.EnterActions>
  628. <MultiTrigger.Conditions>
  629. <Condition Property="IsMouseOver" Value="True" />
  630. <Condition Property="IsChecked" Value="False" />
  631. </MultiTrigger.Conditions>
  632. <Setter TargetName="bd" Property="Background" Value="Red" />
  633. </MultiTrigger>
  634. </ControlTemplate.Triggers>
  635. </ControlTemplate>
  636. </Setter.Value>
  637. </Setter>
  638. </Style>
  639. <!-- 底部工具栏的RadionButton StateBar Design Token -->
  640. <Style x:Key="StateBarRbt" TargetType="{x:Type RadioButton}">
  641. <Setter Property="Foreground" Value="{StaticResource color.icon.base.neutral.norm.lv1}" />
  642. <Setter Property="Background" Value="Transparent" />
  643. <Setter Property="FontSize" Value="18" />
  644. <Setter Property="Cursor" Value="Hand" />
  645. <Setter Property="Margin" Value="0,0,10,10" />
  646. <Setter Property="Height" Value="32" />
  647. <Setter Property="Template">
  648. <Setter.Value>
  649. <ControlTemplate TargetType="{x:Type RadioButton}">
  650. <Border
  651. x:Name="fore"
  652. Background="{TemplateBinding Background}"
  653. BorderThickness="0"
  654. CornerRadius="{StaticResource border-radius.4}">
  655. <ContentPresenter
  656. x:Name="content"
  657. HorizontalAlignment="Center"
  658. VerticalAlignment="Center"
  659. Content="{TemplateBinding Content}" />
  660. </Border>
  661. <ControlTemplate.Triggers>
  662. <Trigger Property="IsChecked" Value="true">
  663. <Setter TargetName="fore" Property="Background" Value="{StaticResource color.item-state.sel.bg.lv2}" />
  664. <Setter Property="Foreground" Value="{StaticResource color.icon.base.neutral.sel}" />
  665. </Trigger>
  666. <Trigger Property="IsMouseOver" Value="True">
  667. <Setter TargetName="fore" Property="Background" Value="{StaticResource color.item-state.hov.bg}" />
  668. </Trigger>
  669. </ControlTemplate.Triggers>
  670. </ControlTemplate>
  671. </Setter.Value>
  672. </Setter>
  673. </Style>
  674. <Style x:Key="RadioButtonStyleText" TargetType="{x:Type RadioButton}">
  675. <Setter Property="FocusVisualStyle" Value="{x:Null}" />
  676. <Setter Property="Background" Value="{StaticResource color.icon.checkbox-radio.norm.bg}" />
  677. <Setter Property="BorderBrush" Value="{StaticResource color.icon.checkbox-radio.norm.border}" />
  678. <Setter Property="Foreground" Value="{StaticResource color.sys.text.neutral.lv1}" />
  679. <Setter Property="BorderThickness" Value="1" />
  680. <Setter Property="Padding" Value="8,0,0,0" />
  681. <Setter Property="FontSize" Value="14" />
  682. <Setter Property="FontFamily" Value="Segoe UI" />
  683. <Setter Property="VerticalAlignment" Value="Center" />
  684. <Setter Property="Template">
  685. <Setter.Value>
  686. <ControlTemplate TargetType="{x:Type RadioButton}">
  687. <Grid
  688. x:Name="templateRoot"
  689. Background="Transparent"
  690. SnapsToDevicePixels="True">
  691. <Grid.ColumnDefinitions>
  692. <ColumnDefinition Width="Auto" />
  693. <ColumnDefinition Width="*" />
  694. </Grid.ColumnDefinitions>
  695. <Border
  696. x:Name="radioButtonBorder"
  697. Width="14"
  698. Height="14"
  699. HorizontalAlignment="Center"
  700. VerticalAlignment="Center"
  701. Background="{TemplateBinding Background}"
  702. BorderBrush="{TemplateBinding BorderBrush}"
  703. BorderThickness="{TemplateBinding BorderThickness}"
  704. CornerRadius="100">
  705. <Grid x:Name="markGrid" Margin="1.8">
  706. <Ellipse
  707. x:Name="optionMark"
  708. MinWidth="6"
  709. MinHeight="6"
  710. Fill="{StaticResource color.icon.checkbox-radio.sel.bg}"
  711. Opacity="0" />
  712. </Grid>
  713. </Border>
  714. <ContentPresenter
  715. x:Name="contentPresenter"
  716. Grid.Column="1"
  717. Margin="{TemplateBinding Padding}"
  718. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  719. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  720. Focusable="False"
  721. RecognizesAccessKey="True"
  722. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  723. </Grid>
  724. <ControlTemplate.Triggers>
  725. <Trigger Property="IsMouseOver" Value="true">
  726. <Setter TargetName="radioButtonBorder" Property="BorderBrush" Value="{StaticResource color.icon.checkbox-radio.hov.border}" />
  727. </Trigger>
  728. <Trigger Property="IsEnabled" Value="false">
  729. <Setter TargetName="radioButtonBorder" Property="Background" Value="{StaticResource color.icon.checkbox-radio.dis.bg}" />
  730. <Setter TargetName="radioButtonBorder" Property="BorderBrush" Value="{StaticResource color.icon.checkbox-radio.dis.border}" />
  731. <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource color.icon.checkbox-radio.dis.fill}" />
  732. </Trigger>
  733. <Trigger Property="IsChecked" Value="true">
  734. <Setter TargetName="optionMark" Property="Opacity" Value="1" />
  735. <Setter TargetName="radioButtonBorder" Property="BorderBrush" Value="{StaticResource color.icon.checkbox-radio.hov.border}" />
  736. </Trigger>
  737. <Trigger Property="IsChecked" Value="{x:Null}">
  738. <Setter TargetName="optionMark" Property="Opacity" Value="0.56" />
  739. </Trigger>
  740. </ControlTemplate.Triggers>
  741. </ControlTemplate>
  742. </Setter.Value>
  743. </Setter>
  744. </Style>
  745. </ResourceDictionary>