RingBarArg.cs 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. using SHJX.Service.Model.MvvmCommon;
  2. using System.Windows.Media;
  3. namespace SHJX.Service.Model.Forms
  4. {
  5. public class RingBarArg : PropertyImp
  6. {
  7. /// <summary>
  8. /// 红色进度条是否可见
  9. /// </summary>
  10. private bool roundVisiable;
  11. public bool RoundVisiable
  12. {
  13. get => roundVisiable;
  14. set
  15. {
  16. roundVisiable = value;
  17. RaisePropertyChanged(nameof(RoundVisiable));
  18. }
  19. }
  20. /// <summary>
  21. /// 中间部分要显示的值
  22. /// </summary>
  23. private string currentText;
  24. public string CurrentText
  25. {
  26. get => currentText;
  27. set
  28. {
  29. currentText = value;
  30. RaisePropertyChanged(nameof(CurrentText));
  31. }
  32. }
  33. /// <summary>
  34. /// 红色圆环的值大小
  35. /// </summary>
  36. private double currentCycleValue;
  37. public double CurrentCycleValue
  38. {
  39. get => currentCycleValue;
  40. set
  41. {
  42. currentCycleValue = value;
  43. RaisePropertyChanged(nameof(CurrentCycleValue));
  44. }
  45. }
  46. /// <summary>
  47. /// 中间部分的颜色值
  48. /// </summary>
  49. private SolidColorBrush centerColor;
  50. public SolidColorBrush CenterColor
  51. {
  52. get => centerColor;
  53. set
  54. {
  55. centerColor = value;
  56. centerColor.Freeze();
  57. RaisePropertyChanged(nameof(CenterColor));
  58. }
  59. }
  60. public RingBarArg()
  61. {
  62. RoundVisiable = false;
  63. CurrentText = string.Empty;
  64. CurrentCycleValue = 0.01;
  65. }
  66. }
  67. }