AduRadioButtonIcon.cs 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. using System.Windows;
  2. using System.Windows.Controls;
  3. using System.Windows.Media;
  4. namespace CyberX8_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. , typeof(Brush), typeof(AduRadioButtonIcon), new FrameworkPropertyMetadata(new SolidColorBrush(Colors.Lime)));
  18. /// <summary>
  19. /// 选中时颜色
  20. /// </summary>
  21. public Brush SelectColor
  22. {
  23. get { return (Brush)GetValue(SelectColorProperty); }
  24. set { SetValue(SelectColorProperty, value); }
  25. }
  26. public static readonly DependencyProperty SelectBackgroundProperty = DependencyProperty.Register("SelectBackground"
  27. , typeof(Brush), typeof(AduRadioButtonIcon), new FrameworkPropertyMetadata(new SolidColorBrush(Color.FromArgb(0, 0, 0, 0))));
  28. /// <summary>
  29. /// 选中时背景色颜色
  30. /// </summary>
  31. public Brush SelectBackground
  32. {
  33. get { return (Brush)GetValue(SelectBackgroundProperty); }
  34. set { SetValue(SelectBackgroundProperty, value); }
  35. }
  36. public static readonly DependencyProperty DefaultBackgroundProperty = DependencyProperty.Register("DefaultBackground"
  37. , typeof(Brush), typeof(AduRadioButtonIcon), new FrameworkPropertyMetadata(new SolidColorBrush(Color.FromArgb(0, 0, 0, 0))));
  38. /// <summary>
  39. /// 选中时背景色颜色
  40. /// </summary>
  41. public Brush DefaultBackground
  42. {
  43. get { return (Brush)GetValue(DefaultBackgroundProperty); }
  44. set { SetValue(DefaultBackgroundProperty, value); }
  45. }
  46. }
  47. }