AduRadioButtonIcon.cs 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. using System.Windows;
  2. using System.Windows.Controls;
  3. using System.Windows.Media;
  4. namespace Venus_Themes.CustomControls
  5. {
  6. public class AduRadioButtonIcon : RadioButton
  7. {
  8. public AduRadioButtonIcon()
  9. {
  10. }
  11. static AduRadioButtonIcon()
  12. {
  13. DefaultStyleKeyProperty.OverrideMetadata(typeof(AduRadioButtonIcon), new FrameworkPropertyMetadata(typeof(AduRadioButtonIcon)));
  14. }
  15. public static readonly DependencyProperty SelectColorProperty = DependencyProperty.Register("SelectColor"
  16. , typeof(Brush), typeof(AduRadioButtonIcon), new FrameworkPropertyMetadata(new SolidColorBrush(Color.FromRgb(0,255,255))));
  17. /// <summary>
  18. /// 选中时颜色
  19. /// </summary>
  20. public Brush SelectColor
  21. {
  22. get { return (Brush)GetValue(SelectColorProperty); }
  23. set { SetValue(SelectColorProperty, value); }
  24. }
  25. public static readonly DependencyProperty SelectBackgroundProperty = DependencyProperty.Register("SelectBackground"
  26. , typeof(Brush), typeof(AduRadioButtonIcon), new FrameworkPropertyMetadata(new SolidColorBrush(Color.FromArgb(0, 0, 0, 0))));
  27. /// <summary>
  28. /// 选中时背景色颜色
  29. /// </summary>
  30. public Brush SelectBackground
  31. {
  32. get { return (Brush)GetValue(SelectBackgroundProperty); }
  33. set { SetValue(SelectBackgroundProperty, value); }
  34. }
  35. }
  36. }