MuchinfoRadioButton.cs 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. using System.Windows;
  2. using System.Windows.Controls;
  3. using System.Windows.Media;
  4. namespace Muchinfo.WPF.Controls.Button
  5. {
  6. public class MuchinfoRadioButton : RadioButton
  7. {
  8. static MuchinfoRadioButton()
  9. {
  10. DefaultStyleKeyProperty.OverrideMetadata(typeof(MuchinfoRadioButton), new FrameworkPropertyMetadata(typeof(MuchinfoRadioButton)));
  11. }
  12. #region Dependency Properties Define
  13. public static readonly DependencyProperty BorderFillNormalBrushProperty =
  14. DependencyProperty.Register("BorderFillNormalBrush", typeof(Brush), typeof(MuchinfoRadioButton), new PropertyMetadata());
  15. public static readonly DependencyProperty BorderStrokeNormalBrushProperty =
  16. DependencyProperty.Register("BorderStrokeNormalBrush", typeof(Brush), typeof(MuchinfoRadioButton), new PropertyMetadata());
  17. public static readonly DependencyProperty BorderFillMouserOverBrushProperty =
  18. DependencyProperty.Register("BorderFillMouserOverBrush", typeof(Brush), typeof(MuchinfoRadioButton), new PropertyMetadata());
  19. public static readonly DependencyProperty BorderFillPressedBrushProperty =
  20. DependencyProperty.Register("BorderFillPressedBrush", typeof(Brush), typeof(MuchinfoRadioButton), new PropertyMetadata());
  21. public static readonly DependencyProperty BorderFillDisabledBrushProperty =
  22. DependencyProperty.Register("BorderFillDisabledBrush", typeof(Brush), typeof(MuchinfoRadioButton), new PropertyMetadata());
  23. public static readonly DependencyProperty BorderStrokeDisabledBrushProperty =
  24. DependencyProperty.Register("BorderStrokeDisabledBrush", typeof(Brush), typeof(MuchinfoRadioButton), new PropertyMetadata());
  25. public static readonly DependencyProperty CheckMarkFillBrushProperty =
  26. DependencyProperty.Register("CheckMarkFillBrush", typeof(Brush), typeof(MuchinfoRadioButton), new PropertyMetadata());
  27. public static readonly DependencyProperty RadioSizeProperty =
  28. DependencyProperty.Register("RadioSize", typeof(double), typeof(MuchinfoRadioButton), new PropertyMetadata());
  29. public static readonly DependencyProperty CheckMarkSizeProperty =
  30. DependencyProperty.Register("CheckMarkSize", typeof(double), typeof(MuchinfoRadioButton), new PropertyMetadata());
  31. #endregion
  32. #region Dependency Properties
  33. public Brush BorderFillNormalBrush
  34. {
  35. get { return (Brush)GetValue(BorderFillNormalBrushProperty); }
  36. set { SetValue(BorderFillNormalBrushProperty, value); }
  37. }
  38. public Brush BorderStrokeNormalBrush
  39. {
  40. get { return (Brush)GetValue(BorderStrokeNormalBrushProperty); }
  41. set { SetValue(BorderStrokeNormalBrushProperty, value); }
  42. }
  43. public Brush BorderFillMouserOverBrush
  44. {
  45. get { return (Brush)GetValue(BorderFillMouserOverBrushProperty); }
  46. set { SetValue(BorderFillMouserOverBrushProperty, value); }
  47. }
  48. public Brush BorderFillPressedBrush
  49. {
  50. get { return (Brush)GetValue(BorderFillPressedBrushProperty); }
  51. set { SetValue(BorderFillPressedBrushProperty, value); }
  52. }
  53. public Brush BorderFillDisabledBrush
  54. {
  55. get { return (Brush)GetValue(BorderFillDisabledBrushProperty); }
  56. set { SetValue(BorderFillDisabledBrushProperty, value); }
  57. }
  58. public Brush BorderStrokeDisabledBrush
  59. {
  60. get { return (Brush)GetValue(BorderStrokeDisabledBrushProperty); }
  61. set { SetValue(BorderStrokeDisabledBrushProperty, value); }
  62. }
  63. public Brush CheckMarkFillBrush
  64. {
  65. get { return (Brush)GetValue(CheckMarkFillBrushProperty); }
  66. set { SetValue(CheckMarkFillBrushProperty, value); }
  67. }
  68. public double CheckMarkSize
  69. {
  70. get { return (double)GetValue(CheckMarkSizeProperty); }
  71. set { SetValue(CheckMarkSizeProperty, value); }
  72. }
  73. public double RadioSize
  74. {
  75. get
  76. {
  77. return (double)GetValue(RadioSizeProperty);
  78. }
  79. set { SetValue(RadioSizeProperty, value); }
  80. }
  81. #endregion
  82. }
  83. }