RadioButtonStyle.xaml 51 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807
  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="Margin" Value="-3" />
  429. <Setter Property="Template">
  430. <Setter.Value>
  431. <ControlTemplate TargetType="{x:Type RadioButton}">
  432. <Border
  433. x:Name="templateRoot"
  434. CornerRadius="7"
  435. Background="Transparent"
  436. Height="32"
  437. SnapsToDevicePixels="True">
  438. <Grid>
  439. <Grid.ColumnDefinitions>
  440. <ColumnDefinition Width="20" />
  441. <ColumnDefinition />
  442. </Grid.ColumnDefinitions>
  443. <Path
  444. HorizontalAlignment="Center"
  445. VerticalAlignment="Center"
  446. x:Name="pathIcon"
  447. 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"
  448. Fill="{StaticResource color.icon.base.neutral.norm.lv1}"
  449. Visibility="Collapsed" />
  450. <ContentPresenter
  451. x:Name="contentPresenter"
  452. Grid.Column="1"
  453. Margin="{TemplateBinding Padding}"
  454. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  455. VerticalAlignment="Center"
  456. Focusable="False"
  457. RecognizesAccessKey="True"
  458. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  459. </Grid>
  460. </Border>
  461. <ControlTemplate.Triggers>
  462. <Trigger Property="HasContent" Value="true">
  463. <Setter Property="FocusVisualStyle" Value="{StaticResource OptionMarkFocusVisual}" />
  464. <Setter Property="Padding" Value="4,-1,0,0" />
  465. </Trigger>
  466. <Trigger Property="IsMouseOver" Value="true" />
  467. <Trigger Property="IsEnabled" Value="false">
  468. <Setter TargetName="contentPresenter" Property="Opacity" Value="0.5" />
  469. </Trigger>
  470. <Trigger Property="IsPressed" Value="true" />
  471. <Trigger Property="IsChecked" Value="true">
  472. <Setter TargetName="pathIcon" Property="Visibility" Value="Visible" />
  473. </Trigger>
  474. </ControlTemplate.Triggers>
  475. </ControlTemplate>
  476. </Setter.Value>
  477. </Setter>
  478. </Style>
  479. <!-- 悬浮灰色背景单选按钮 -->
  480. <Style x:Key="GreyBgRadioBtnStyle" TargetType="{x:Type RadioButton}">
  481. <Setter Property="BorderThickness" Value="1" />
  482. <Setter Property="Foreground" Value="#252629" />
  483. <Setter Property="Template">
  484. <Setter.Value>
  485. <ControlTemplate TargetType="{x:Type RadioButton}">
  486. <Border
  487. x:Name="templateRoot"
  488. Background="{TemplateBinding Background}"
  489. CornerRadius="4"
  490. SnapsToDevicePixels="True">
  491. <ContentPresenter
  492. x:Name="contentPresenter"
  493. Grid.Column="1"
  494. Margin="{TemplateBinding Padding}"
  495. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  496. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  497. Focusable="False"
  498. RecognizesAccessKey="True"
  499. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  500. </Border>
  501. <ControlTemplate.Triggers>
  502. <Trigger Property="HasContent" Value="true">
  503. <Setter Property="FocusVisualStyle" Value="{StaticResource OptionMarkFocusVisual}" />
  504. <Setter Property="Padding" Value="4,-1,0,0" />
  505. </Trigger>
  506. <Trigger Property="IsMouseOver" Value="true">
  507. <Setter TargetName="templateRoot" Property="Background" Value="{StaticResource color.item-state.hov.bg}" />
  508. </Trigger>
  509. <Trigger Property="IsEnabled" Value="false">
  510. <Setter TargetName="templateRoot" Property="Opacity" Value="0.5" />
  511. </Trigger>
  512. <Trigger Property="IsPressed" Value="true" />
  513. <Trigger Property="IsChecked" Value="true">
  514. <Setter TargetName="templateRoot" Property="Background" Value="{StaticResource color.item-state.sel.bg.lv3}" />
  515. <Setter TargetName="templateRoot" Property="BorderBrush" Value="{StaticResource color.item-state.sel.border.lv3}" />
  516. <Setter Property="Foreground" Value="#616469" />
  517. <Setter TargetName="templateRoot" Property="BorderThickness" Value="1" />
  518. </Trigger>
  519. </ControlTemplate.Triggers>
  520. </ControlTemplate>
  521. </Setter.Value>
  522. </Setter>
  523. </Style>
  524. <Style x:Key="GreyBgRadioBtnStyle2" TargetType="{x:Type RadioButton}">
  525. <Setter Property="FocusVisualStyle" Value="{x:Null}" />
  526. <Setter Property="BorderThickness" Value="1" />
  527. <Setter Property="Foreground" Value="#616469" />
  528. <Setter Property="Background" Value="Transparent" />
  529. <Setter Property="Template">
  530. <Setter.Value>
  531. <ControlTemplate TargetType="{x:Type RadioButton}">
  532. <Border
  533. x:Name="templateRoot"
  534. Background="{TemplateBinding Background}"
  535. CornerRadius="4"
  536. SnapsToDevicePixels="True">
  537. <ContentPresenter
  538. x:Name="contentPresenter"
  539. Grid.Column="1"
  540. Margin="{TemplateBinding Padding}"
  541. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  542. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  543. Focusable="False"
  544. RecognizesAccessKey="True"
  545. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  546. </Border>
  547. <ControlTemplate.Triggers>
  548. <Trigger Property="HasContent" Value="true">
  549. <Setter Property="FocusVisualStyle" Value="{x:Null}" />
  550. <!--<Setter Property="Padding" Value="6,6,0,0" />-->
  551. <Setter Property="HorizontalContentAlignment" Value="Center" />
  552. <Setter Property="VerticalContentAlignment" Value="Center" />
  553. </Trigger>
  554. <Trigger Property="IsMouseOver" Value="true">
  555. <Setter TargetName="templateRoot" Property="Background" Value="{StaticResource color.item-state.hov.bg}" />
  556. </Trigger>
  557. <Trigger Property="IsEnabled" Value="false">
  558. <Setter TargetName="templateRoot" Property="Opacity" Value="0.5" />
  559. </Trigger>
  560. <Trigger Property="IsPressed" Value="true" />
  561. <Trigger Property="IsChecked" Value="true">
  562. <Setter TargetName="templateRoot" Property="Background" Value="{StaticResource color.item-state.sel.bg.lv3}" />
  563. <Setter TargetName="templateRoot" Property="BorderBrush" Value="{StaticResource color.item-state.sel.border.lv3}" />
  564. <Setter Property="Foreground" Value="#252629" />
  565. <Setter TargetName="templateRoot" Property="BorderThickness" Value="1" />
  566. </Trigger>
  567. </ControlTemplate.Triggers>
  568. </ControlTemplate>
  569. </Setter.Value>
  570. </Setter>
  571. </Style>
  572. <Style x:Key="BatchButton" TargetType="{x:Type RadioButton}">
  573. <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
  574. <Setter Property="Background" Value="#F7F8FA" />
  575. <Setter Property="BorderThickness" Value="0" />
  576. <Setter Property="Cursor" Value="Hand" />
  577. <Setter Property="Template">
  578. <Setter.Value>
  579. <ControlTemplate TargetType="{x:Type RadioButton}">
  580. <ControlTemplate.Resources>
  581. <Storyboard x:Key="Storyboard1">
  582. <ColorAnimationUsingKeyFrames Storyboard.TargetName="bd" Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)">
  583. <EasingColorKeyFrame KeyTime="0" Value="White" />
  584. <EasingColorKeyFrame KeyTime="0:0:0.3" Value="#FFAFAFAF" />
  585. </ColorAnimationUsingKeyFrames>
  586. </Storyboard>
  587. <Storyboard x:Key="Storyboard2">
  588. <ColorAnimationUsingKeyFrames Storyboard.TargetName="bd" Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)">
  589. <EasingColorKeyFrame KeyTime="0" Value="#FFAFAFAF" />
  590. <EasingColorKeyFrame KeyTime="0:0:0.5" Value="#D3D3D3" />
  591. </ColorAnimationUsingKeyFrames>
  592. </Storyboard>
  593. </ControlTemplate.Resources>
  594. <BulletDecorator Background="Transparent">
  595. <Border
  596. x:Name="bd"
  597. HorizontalAlignment="Center"
  598. Background="White"
  599. CornerRadius="5">
  600. <Border.OpacityMask>
  601. <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
  602. <GradientStop Offset="0" Color="Black" />
  603. <GradientStop Offset="1" Color="White" />
  604. </LinearGradientBrush>
  605. </Border.OpacityMask>
  606. <ContentPresenter
  607. Width="{TemplateBinding Width}"
  608. Height="{TemplateBinding Height}"
  609. Margin="{TemplateBinding Padding}"
  610. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  611. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  612. RecognizesAccessKey="True" />
  613. </Border>
  614. </BulletDecorator>
  615. <ControlTemplate.Triggers>
  616. <Trigger Property="IsEnabled" Value="false">
  617. <Setter TargetName="bd" Property="Background" Value="gray" />
  618. </Trigger>
  619. <Trigger Property="IsChecked" Value="false">
  620. <Setter TargetName="bd" Property="Background" Value="{x:Null}" />
  621. </Trigger>
  622. <Trigger Property="IsChecked" Value="true">
  623. <Trigger.EnterActions>
  624. <BeginStoryboard x:Name="Storyboard2_BeginStoryboard" Storyboard="{StaticResource Storyboard2}" />
  625. </Trigger.EnterActions>
  626. <Setter TargetName="bd" Property="Background" Value="#FF606060" />
  627. </Trigger>
  628. <MultiTrigger>
  629. <MultiTrigger.EnterActions>
  630. <BeginStoryboard Storyboard="{StaticResource Storyboard1}" />
  631. </MultiTrigger.EnterActions>
  632. <MultiTrigger.Conditions>
  633. <Condition Property="IsMouseOver" Value="True" />
  634. <Condition Property="IsChecked" Value="False" />
  635. </MultiTrigger.Conditions>
  636. <Setter TargetName="bd" Property="Background" Value="Red" />
  637. </MultiTrigger>
  638. </ControlTemplate.Triggers>
  639. </ControlTemplate>
  640. </Setter.Value>
  641. </Setter>
  642. </Style>
  643. <!-- 底部工具栏的RadionButton StateBar Design Token -->
  644. <Style x:Key="StateBarRbt" TargetType="{x:Type RadioButton}">
  645. <Setter Property="Foreground" Value="{StaticResource color.icon.base.neutral.norm.lv1}" />
  646. <Setter Property="Background" Value="Transparent" />
  647. <Setter Property="FontSize" Value="18" />
  648. <Setter Property="Cursor" Value="Hand" />
  649. <Setter Property="Margin" Value="0,0,10,10" />
  650. <Setter Property="Height" Value="32" />
  651. <Setter Property="Template">
  652. <Setter.Value>
  653. <ControlTemplate TargetType="{x:Type RadioButton}">
  654. <Border
  655. x:Name="fore"
  656. Background="{TemplateBinding Background}"
  657. BorderThickness="0"
  658. CornerRadius="{StaticResource border-radius.4}">
  659. <ContentPresenter
  660. x:Name="content"
  661. HorizontalAlignment="Center"
  662. VerticalAlignment="Center"
  663. Content="{TemplateBinding Content}" />
  664. </Border>
  665. <ControlTemplate.Triggers>
  666. <Trigger Property="IsChecked" Value="true">
  667. <Setter TargetName="fore" Property="Background" Value="{StaticResource color.item-state.sel.bg.lv2}" />
  668. <Setter Property="Foreground" Value="{StaticResource color.icon.base.neutral.sel}" />
  669. </Trigger>
  670. <Trigger Property="IsMouseOver" Value="True">
  671. <Setter TargetName="fore" Property="Background" Value="{StaticResource color.item-state.hov.bg}" />
  672. </Trigger>
  673. </ControlTemplate.Triggers>
  674. </ControlTemplate>
  675. </Setter.Value>
  676. </Setter>
  677. </Style>
  678. <Style x:Key="RadioButtonStyleText" TargetType="{x:Type RadioButton}">
  679. <Setter Property="FocusVisualStyle" Value="{x:Null}" />
  680. <Setter Property="Background" Value="{StaticResource color.icon.checkbox-radio.norm.bg}" />
  681. <Setter Property="BorderBrush" Value="{StaticResource color.icon.checkbox-radio.norm.border}" />
  682. <Setter Property="Foreground" Value="{StaticResource color.sys.text.neutral.lv1}" />
  683. <Setter Property="BorderThickness" Value="1" />
  684. <Setter Property="Padding" Value="8,0,0,0" />
  685. <Setter Property="FontSize" Value="14" />
  686. <Setter Property="FontFamily" Value="Segoe UI" />
  687. <Setter Property="VerticalAlignment" Value="Center" />
  688. <Setter Property="Template">
  689. <Setter.Value>
  690. <ControlTemplate TargetType="{x:Type RadioButton}">
  691. <Grid
  692. x:Name="templateRoot"
  693. Background="Transparent"
  694. SnapsToDevicePixels="True">
  695. <Grid.ColumnDefinitions>
  696. <ColumnDefinition Width="Auto" />
  697. <ColumnDefinition Width="*" />
  698. </Grid.ColumnDefinitions>
  699. <Border
  700. x:Name="radioButtonBorder"
  701. Width="14"
  702. Height="14"
  703. HorizontalAlignment="Center"
  704. VerticalAlignment="Center"
  705. Background="{TemplateBinding Background}"
  706. BorderBrush="{TemplateBinding BorderBrush}"
  707. BorderThickness="{TemplateBinding BorderThickness}"
  708. CornerRadius="100">
  709. <Grid x:Name="markGrid" Margin="1.8">
  710. <Ellipse
  711. x:Name="optionMark"
  712. MinWidth="6"
  713. MinHeight="6"
  714. Fill="{StaticResource color.icon.checkbox-radio.sel.bg}"
  715. Opacity="0" />
  716. </Grid>
  717. </Border>
  718. <ContentPresenter
  719. x:Name="contentPresenter"
  720. Grid.Column="1"
  721. Margin="{TemplateBinding Padding}"
  722. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  723. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  724. Focusable="False"
  725. RecognizesAccessKey="True"
  726. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  727. </Grid>
  728. <ControlTemplate.Triggers>
  729. <Trigger Property="IsMouseOver" Value="true">
  730. <Setter TargetName="radioButtonBorder" Property="BorderBrush" Value="{StaticResource color.icon.checkbox-radio.hov.border}" />
  731. </Trigger>
  732. <Trigger Property="IsEnabled" Value="false">
  733. <Setter TargetName="radioButtonBorder" Property="Background" Value="{StaticResource color.icon.checkbox-radio.dis.bg}" />
  734. <Setter TargetName="radioButtonBorder" Property="BorderBrush" Value="{StaticResource color.icon.checkbox-radio.dis.border}" />
  735. <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource color.icon.checkbox-radio.dis.fill}" />
  736. </Trigger>
  737. <Trigger Property="IsChecked" Value="true">
  738. <Setter TargetName="optionMark" Property="Opacity" Value="1" />
  739. <Setter TargetName="radioButtonBorder" Property="BorderBrush" Value="{StaticResource color.icon.checkbox-radio.hov.border}" />
  740. </Trigger>
  741. <Trigger Property="IsChecked" Value="{x:Null}">
  742. <Setter TargetName="optionMark" Property="Opacity" Value="0.56" />
  743. </Trigger>
  744. </ControlTemplate.Triggers>
  745. </ControlTemplate>
  746. </Setter.Value>
  747. </Setter>
  748. </Style>
  749. <Style x:Key="HomeContentLeftBtn" TargetType="{x:Type RadioButton}">
  750. <Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual}" />
  751. <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
  752. <Setter Property="BorderThickness" Value="0" />
  753. <Setter Property="HorizontalContentAlignment" Value="Center" />
  754. <Setter Property="VerticalContentAlignment" Value="Center" />
  755. <Setter Property="Background" Value="Transparent" />
  756. <Setter Property="BorderBrush" Value="Transparent" />
  757. <Setter Property="IsTabStop" Value="False" />
  758. <Setter Property="Template">
  759. <Setter.Value>
  760. <ControlTemplate TargetType="{x:Type RadioButton}">
  761. <Border
  762. x:Name="border"
  763. CornerRadius="8"
  764. Background="{TemplateBinding Background}"
  765. BorderBrush="{TemplateBinding BorderBrush}"
  766. BorderThickness="{TemplateBinding BorderThickness}"
  767. SnapsToDevicePixels="true">
  768. <ContentPresenter
  769. x:Name="contentPresenter"
  770. Margin="{TemplateBinding Padding}"
  771. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  772. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  773. Focusable="False"
  774. RecognizesAccessKey="True"
  775. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  776. </Border>
  777. <ControlTemplate.Triggers>
  778. <Trigger Property="IsChecked" Value="true">
  779. <Setter TargetName="border" Property="Background" Value="{StaticResource color.item-state.sel.bg.lv1}" />
  780. <Setter Property="Foreground" Value="{StaticResource color.item-state.sel.bg.lv2}" />
  781. </Trigger>
  782. <Trigger Property="IsMouseOver" Value="True">
  783. <Setter TargetName="border" Property="Background" Value="{StaticResource color.item-state.sel.bg.lv2}" />
  784. </Trigger>
  785. </ControlTemplate.Triggers>
  786. </ControlTemplate>
  787. </Setter.Value>
  788. </Setter>
  789. </Style>
  790. </ResourceDictionary>