AnnotToolContentViewModel.Properties.cs 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230
  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. // 填写与签名图案名字链表
  103. private List<string> ShapeNames = new List<string>();
  104. // 是否处于打印
  105. private bool IsPasteShape = false;
  106. public string PropertyRegionName { get; set; }
  107. private IEventAggregator events;
  108. public IDialogService dialogs;
  109. public IRegionManager region;
  110. public OpenFileInfo OpenFileInfo = null;
  111. public CPDFViewer PDFViewer;
  112. private ViewContentViewModel viewContentViewModel;
  113. private AnnotTransfer PropertyPanel = new AnnotTransfer();
  114. private Dictionary<string, AnnotArgsType> ToolExpandDict = new Dictionary<string, AnnotArgsType>();
  115. private Dictionary<string, string> ToolTipDict = new Dictionary<string, string>();
  116. private StickyNotePopup customStickyPopup;
  117. private string Unicode = "";
  118. //private bool isHiddenAnnot = true;
  119. private bool isAddBookMark = true;
  120. private bool IsNoSelectMenu = false;
  121. private bool isRightMenuAddAnnot = false;
  122. private PopMenu HightAnnotPopMenu;
  123. private PopMenu FreeHandAnnotPopMenu;
  124. private PopMenu FreeTextAnnotPopMenu;
  125. private PopMenu StrickNoteAnnotPopMenu;
  126. private PopMenu ShapeAnnotPopMenu;
  127. private PopMenu LinkAnnotPopMenu;
  128. private PopMenu StampAnnotPopMenu;
  129. private PopMenu MultiAnnotPopMenu;
  130. #region 事件
  131. public DelegateCommand<CustomIconToggleBtn> ShowOrHiddenAnnotCommand { get; set; }
  132. public DelegateCommand<CustomIconToggleBtn> MyToolsCommand { get; set; }
  133. private SnapshotEditMenuViewModel snapshotEditMenuViewModel = new SnapshotEditMenuViewModel();
  134. public SnapshotEditMenuViewModel SnapshotEditMenuViewModel { get => snapshotEditMenuViewModel; set => snapshotEditMenuViewModel = value; }
  135. public DelegateCommand<object> SetAddAnnotationCommand { get; set; }
  136. public DelegateCommand AddBookMarkCommand { get; set; }
  137. public DelegateCommand HandCommand { get; set; }
  138. #region 注释 - 右键菜单
  139. //公共
  140. public DelegateCommand<object> AnnotDefaultValue_MenuCommand { get; set; }
  141. public DelegateCommand<object> AnnotColorPalette_MenuCommand { get; set; }
  142. public DelegateCommand<object> AnnotAddNoteText_MenuCommand { get; set; }
  143. //高亮、下划线、删除
  144. public DelegateCommand<object> HightAnnotCopyText_MenuCommand { get; set; }
  145. //手绘
  146. public DelegateCommand<object> FreeHandLineStyle_MenuCommand { get; set; }
  147. //文本
  148. public DelegateCommand<object> FreeTextFontFamily_MenuCommand { get; set; }
  149. public DelegateCommand<object> FreeTextAglin_MenuCommand { get; set; }
  150. //便签
  151. public DelegateCommand<object> StrikeNoteEditStrike_MenuCommand { get; set; }
  152. //形状
  153. public DelegateCommand<object> ShapeLineStyle_MenuCommand { get; set; }
  154. public DelegateCommand<object> ShapeLineDirect_MenuCommand { get; set; }
  155. //图章
  156. public DelegateCommand<object> StampExportPicture_MenuCommand { get; set; }
  157. //链接
  158. public DelegateCommand<object> Link_MenuCommand { get; set; }
  159. #endregion 注释 - 右键菜单
  160. #endregion 事件
  161. }
  162. public enum AddAnnotType
  163. {
  164. AnnotFreehand,//绘制
  165. AnnotFreeText = 1,//文本
  166. AnnotSticky,//便签
  167. AnnotSquare,//矩形
  168. AnnotCircle,//椭圆形
  169. AnnotArrow,//箭头
  170. AnnotLine,//直线
  171. AnnotLink,//链接
  172. AnnotStamp,//图章
  173. AnnotAutograph //签名
  174. }
  175. }