AnnotToolContentViewModel.Properties.cs 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  1. using ComPDFKitViewer;
  2. using ComPDFKitViewer.AnnotEvent;
  3. using ComPDFKitViewer.PdfViewer;
  4. using PDF_Master.CustomControl;
  5. using PDF_Master.Helper;
  6. using PDF_Master.ViewModels.PropertyPanel.AnnotPanel;
  7. using PDF_Master.ViewModels.Tools.AnnotManager;
  8. using PDF_Master.Views.PropertyPanel.AnnotPanel;
  9. using PDFSettings.Settings;
  10. using Prism.Commands;
  11. using Prism.Events;
  12. using Prism.Regions;
  13. using Prism.Services.Dialogs;
  14. using System;
  15. using System.Collections.Generic;
  16. using System.Windows.Media;
  17. namespace PDF_Master.ViewModels.Tools
  18. {
  19. public sealed partial class AnnotToolContentViewModel
  20. {
  21. #region 属性
  22. #region 注释工具
  23. //高亮
  24. private Brush highLightColor = new SolidColorBrush(Color.FromRgb(0xFF, 0xBB, 0x00));
  25. public Brush HighLightColor
  26. { get { return highLightColor; } set { SetProperty(ref highLightColor, value); } }
  27. //
  28. private double highLightOpacity = 1;
  29. public double HighLightOpacity
  30. { get { return highLightOpacity; } set { SetProperty(ref highLightOpacity, value); } }
  31. //
  32. private Brush underLine = new SolidColorBrush(Color.FromRgb(0xFF, 0xBB, 0x00));
  33. public Brush UnderLineColor
  34. { get { return underLine; } set { SetProperty(ref underLine, value); } }
  35. //
  36. private double underLineOpacity = 1;
  37. public double UnderLineOpacity
  38. { get { return underLineOpacity; } set { SetProperty(ref underLineOpacity, value); } }
  39. //
  40. private Brush squigglyColor = new SolidColorBrush(Color.FromRgb(0xFF, 0xBB, 0x00));
  41. public Brush SquigglyColor
  42. { get { return squigglyColor; } set { SetProperty(ref squigglyColor, value); } }
  43. //
  44. private double squigglyOpacity = 1;
  45. public double SquigglyOpacity
  46. { get { return squigglyOpacity; } set { SetProperty(ref squigglyOpacity, value); } }
  47. //
  48. private Brush strikeoutColor = new SolidColorBrush(Color.FromRgb(0xFF, 0xBB, 0x00));
  49. public Brush StrikeoutColor
  50. { get { return strikeoutColor; } set { SetProperty(ref strikeoutColor, value); } }
  51. //
  52. private double strikeoutOpacity = 1;
  53. public double StrikeoutOpacity
  54. { get { return strikeoutOpacity; } set { SetProperty(ref strikeoutOpacity, value); } }
  55. private bool btnSelecttoolIsChecked = false;
  56. public bool BtnSelecttoolIsChecked
  57. {
  58. get { return btnSelecttoolIsChecked; }
  59. set
  60. {
  61. SetProperty(ref btnSelecttoolIsChecked, value);
  62. }
  63. }
  64. private bool btnLinkIsChecked = false;
  65. public bool BtnLinkIsChecked
  66. {
  67. get { return btnLinkIsChecked; }
  68. set
  69. {
  70. SetProperty(ref btnLinkIsChecked, value);
  71. }
  72. }
  73. private bool btnHandIsChecked = false;
  74. public bool BtnHandIsChecked
  75. {
  76. get { return btnHandIsChecked; }
  77. set
  78. {
  79. SetProperty(ref btnHandIsChecked, value);
  80. }
  81. }
  82. private bool btnShowAnnotIsChecked = true;
  83. public bool BtnShowAnnotIsChecked
  84. {
  85. get { return btnShowAnnotIsChecked; }
  86. set
  87. {
  88. SetProperty(ref btnShowAnnotIsChecked, value);
  89. }
  90. }
  91. private string _strAnnotToolChecked = "";
  92. public string StrAnnotToolChecked
  93. {
  94. get { return _strAnnotToolChecked; }
  95. set
  96. {
  97. SetProperty(ref _strAnnotToolChecked, value);
  98. }
  99. }
  100. #endregion 注释工具
  101. #endregion 属性
  102. public string PropertyRegionName { get; set; }
  103. private IEventAggregator events;
  104. public IDialogService dialogs;
  105. public IRegionManager region;
  106. public OpenFileInfo OpenFileInfo = null;
  107. public CPDFViewer PDFViewer;
  108. private ViewContentViewModel viewContentViewModel;
  109. private AnnotTransfer propertyPanel = new AnnotTransfer();
  110. private Dictionary<string, AnnotArgsType> ToolExpandDict = new Dictionary<string, AnnotArgsType>();
  111. private Dictionary<string, string> ToolTipDict = new Dictionary<string, string>();
  112. private StickyNotePopup customStickyPopup;
  113. string Unicode = "";
  114. //private bool isHiddenAnnot = true;
  115. private bool isAddBookMark = true;
  116. private bool IsNoSelectMenu = false;
  117. private bool isRightMenuAddAnnot = false;
  118. private PopMenu HightAnnotPopMenu;
  119. private PopMenu FreeHandAnnotPopMenu;
  120. private PopMenu FreeTextAnnotPopMenu;
  121. private PopMenu StrickNoteAnnotPopMenu;
  122. private PopMenu ShapeAnnotPopMenu;
  123. private PopMenu LinkAnnotPopMenu;
  124. private PopMenu StampAnnotPopMenu;
  125. private PopMenu MultiAnnotPopMenu;
  126. #region 事件
  127. public DelegateCommand<CustomIconToggleBtn> MyToolsCommand { get; set; }
  128. private SnapshotEditMenuViewModel snapshotEditMenuViewModel = new SnapshotEditMenuViewModel();
  129. public SnapshotEditMenuViewModel SnapshotEditMenuViewModel { get => snapshotEditMenuViewModel; set => snapshotEditMenuViewModel = value; }
  130. public DelegateCommand<object> SetAddAnnotationCommand { get; set; }
  131. public DelegateCommand AddBookMarkCommand { get; set; }
  132. public DelegateCommand HandCommand { get; set; }
  133. #region 注释 - 右键菜单
  134. //公共
  135. public DelegateCommand<object> AnnotDefaultValue_MenuCommand { get; set; }
  136. public DelegateCommand<object> AnnotColorPalette_MenuCommand { get; set; }
  137. public DelegateCommand<object> AnnotAddNoteText_MenuCommand { get; set; }
  138. //高亮、下划线、删除
  139. public DelegateCommand<object> HightAnnotCopyText_MenuCommand { get; set; }
  140. //手绘
  141. public DelegateCommand<object> FreeHandLineStyle_MenuCommand { get; set; }
  142. //文本
  143. public DelegateCommand<object> FreeTextFontFamily_MenuCommand { get; set; }
  144. public DelegateCommand<object> FreeTextAglin_MenuCommand { get; set; }
  145. //便签
  146. public DelegateCommand<object> StrikeNoteEditStrike_MenuCommand { get; set; }
  147. //形状
  148. public DelegateCommand<object> ShapeLineStyle_MenuCommand { get; set; }
  149. public DelegateCommand<object> ShapeLineDirect_MenuCommand { get; set; }
  150. //图章
  151. public DelegateCommand<object> StampExportPicture_MenuCommand { get; set; }
  152. //链接
  153. public DelegateCommand<object> Link_MenuCommand { get; set; }
  154. #endregion 注释 - 右键菜单
  155. #endregion 事件
  156. }
  157. public enum AddAnnotType
  158. {
  159. AnnotFreehand,//绘制
  160. AnnotFreeText = 1,//文本
  161. AnnotSticky,//便签
  162. AnnotSquare,//矩形
  163. AnnotCircle,//椭圆形
  164. AnnotArrow,//箭头
  165. AnnotLine,//直线
  166. AnnotLink,//链接
  167. AnnotStamp,//图章
  168. AnnotAutograph //签名
  169. }
  170. }