RadioButtonStyle.xaml 1.8 KB

1234567891011121314151617181920212223242526272829303132333435
  1. <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  2. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
  3. <Style x:Key="ColorRadioButtonStyle" TargetType="{x:Type RadioButton}">
  4. <Setter Property="Template">
  5. <Setter.Value>
  6. <ControlTemplate TargetType="{x:Type RadioButton}">
  7. <Grid>
  8. <Ellipse x:Name="BorderEllipse"
  9. Stroke="{TemplateBinding BorderBrush}"
  10. StrokeThickness="{TemplateBinding BorderThickness}"
  11. Width="{TemplateBinding Width}"
  12. Height="{TemplateBinding Height}" />
  13. <Ellipse x:Name="InnerEllipse"
  14. Fill="{TemplateBinding Background}"
  15. StrokeThickness="0"
  16. Width="{Binding ActualWidth, ElementName=BorderEllipse}"
  17. Height="{Binding ActualHeight, ElementName=BorderEllipse}"
  18. Margin="{Binding ActualWidth, ElementName=BorderEllipse}" />
  19. </Grid>
  20. <ControlTemplate.Triggers>
  21. <Trigger Property="IsChecked" Value="True">
  22. <Setter TargetName="BorderEllipse" Property="StrokeThickness" Value="2" />
  23. </Trigger>
  24. <Trigger Property="IsMouseOver" Value="True">
  25. <Setter TargetName="BorderEllipse" Property="StrokeThickness" Value="1" />
  26. </Trigger>
  27. </ControlTemplate.Triggers>
  28. </ControlTemplate>
  29. </Setter.Value>
  30. </Setter>
  31. </Style>
  32. </ResourceDictionary>