CircleBase.cs 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Windows;
  6. using System.Windows.Controls;
  7. using System.Windows.Controls.Primitives;
  8. namespace CustomUI.MyControls.Primitives
  9. {
  10. /// <summary>
  11. /// 圆形基类
  12. /// </summary>
  13. public class CircleBase : RangeBase
  14. {
  15. /// <summary>
  16. /// 刻度盘起始角度依赖属性
  17. /// </summary>
  18. public static readonly DependencyProperty StartAngleProperty;
  19. /// <summary>
  20. /// 刻度盘结束角度依赖属性
  21. /// </summary>
  22. public static readonly DependencyProperty EndAngleProperty;
  23. static CircleBase()
  24. {
  25. CircleBase.StartAngleProperty = DependencyProperty.Register("StartAngle",
  26. typeof(double),
  27. typeof(CircleBase),
  28. new PropertyMetadata(0d));
  29. CircleBase.EndAngleProperty = DependencyProperty.Register("EndAngle",
  30. typeof(double),
  31. typeof(CircleBase),
  32. new PropertyMetadata(360d));
  33. }
  34. #region Angle 刻度盘起始角度
  35. /// <summary>
  36. /// 刻度盘起始角度
  37. /// </summary>
  38. public double StartAngle
  39. {
  40. get { return (double)GetValue(StartAngleProperty); }
  41. set { SetValue(StartAngleProperty, value); }
  42. }
  43. #endregion
  44. #region Angle 刻度盘结束角度依赖属性
  45. public double EndAngle
  46. {
  47. get { return (double)GetValue(EndAngleProperty); }
  48. set { SetValue(EndAngleProperty, value); }
  49. }
  50. #endregion
  51. }
  52. }