星火微课系统客户端
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

AppModel.cs 4.1KB

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