星火微课系统客户端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

AppModel.cs 4.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. using ComeCapture.Models;
  2. using System.Text;
  3. namespace ComeCapture
  4. {
  5. public class AppModel : EntityBase
  6. {
  7. public AppModel()
  8. {
  9. _current = this;
  10. }
  11. #region 属性 Current
  12. private static AppModel _current;
  13. public static AppModel Current => _current;
  14. #endregion 属性 Current
  15. #region 属性 MaskLeftWidth
  16. private double _maskLeftWidth = JieTuWindow.ScreenWidth;
  17. public double MaskLeftWidth
  18. {
  19. get => _maskLeftWidth;
  20. set
  21. {
  22. _maskLeftWidth = value;
  23. ShowSizeLeft = value;
  24. RaisePropertyChanged(() => MaskLeftWidth);
  25. }
  26. }
  27. #endregion 属性 MaskLeftWidth
  28. #region 属性 MaskRightWidth
  29. private double _maskRightWidth;
  30. public double MaskRightWidth
  31. {
  32. get => _maskRightWidth;
  33. set
  34. {
  35. _maskRightWidth = value;
  36. RaisePropertyChanged(() => MaskRightWidth);
  37. }
  38. }
  39. #endregion 属性 MaskRightWidth
  40. #region 属性 MaskTopWidth
  41. private double _maskTopWidth;
  42. public double MaskTopWidth
  43. {
  44. get => _maskTopWidth;
  45. set
  46. {
  47. _maskTopWidth = value;
  48. RaisePropertyChanged(() => MaskTopWidth);
  49. }
  50. }
  51. #endregion 属性 MaskTopWidth
  52. #region 属性 MaskTopHeight
  53. private double _maskTopHeight;
  54. public double MaskTopHeight
  55. {
  56. get => _maskTopHeight;
  57. set
  58. {
  59. _maskTopHeight = value;
  60. ShowSizeTop = MaskTopHeight < 40 ? MaskTopHeight : MaskTopHeight - 40;
  61. RaisePropertyChanged(() => MaskTopHeight);
  62. }
  63. }
  64. #endregion 属性 MaskTopHeight
  65. #region 属性 MaskBottomHeight
  66. private double _maskBottomHeight;
  67. public double MaskBottomHeight
  68. {
  69. get => _maskBottomHeight;
  70. set
  71. {
  72. _maskBottomHeight = value;
  73. RaisePropertyChanged(() => MaskBottomHeight);
  74. }
  75. }
  76. #endregion 属性 MaskBottomHeight
  77. #region 属性 ShowSize
  78. private string _showSize = "0 × 0";
  79. public string ShowSize
  80. {
  81. get => _showSize;
  82. set
  83. {
  84. _showSize = value;
  85. RaisePropertyChanged(() => ShowSize);
  86. }
  87. }
  88. private static StringBuilder _sb = new StringBuilder();
  89. public void ChangeShowSize()
  90. {
  91. _sb = new StringBuilder();
  92. _sb.Append((int)(JieTuWindow.Current.MainImage.Width * JieTuWindow.ScreenScale));
  93. _sb.Append(" × ");
  94. _sb.Append((int)(JieTuWindow.Current.MainImage.Height * JieTuWindow.ScreenScale));
  95. ShowSize = _sb.ToString();
  96. }
  97. #endregion 属性 ShowSize
  98. #region 属性 ShowSizeLeft
  99. private double _showSizeLeft;
  100. public double ShowSizeLeft
  101. {
  102. get => _showSizeLeft;
  103. set
  104. {
  105. _showSizeLeft = value;
  106. RaisePropertyChanged(() => ShowSizeLeft);
  107. }
  108. }
  109. #endregion 属性 ShowSizeLeft
  110. #region 属性 ShowSizeTop
  111. private double _showSizeTop;
  112. public double ShowSizeTop
  113. {
  114. get => _showSizeTop;
  115. set
  116. {
  117. _showSizeTop = value;
  118. RaisePropertyChanged(() => ShowSizeTop);
  119. }
  120. }
  121. #endregion 属性 ShowSizeTop
  122. #region 属性 ShowRGB
  123. private string _showRgb = string.Empty;
  124. public string ShowRGB
  125. {
  126. get => _showRgb;
  127. set
  128. {
  129. _showRgb = value;
  130. RaisePropertyChanged(() => ShowRGB);
  131. }
  132. }
  133. #endregion 属性 ShowRGB
  134. }
  135. }