AnnotToolContentViewModel.Properties.cs 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  1. using ComPDFKitViewer;
  2. using ComPDFKitViewer.AnnotEvent;
  3. using ComPDFKitViewer.PdfViewer;
  4. using PDF_Office.CustomControl;
  5. using PDF_Office.Helper;
  6. using PDF_Office.ViewModels.PropertyPanel.AnnotPanel;
  7. using PDF_Office.ViewModels.Tools.AnnotManager;
  8. using PDF_Office.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_Office.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 List<Tuple<int, int>> AnnotSignatures = new List<Tuple<int, int>>();
  113. private StickyNotePopup customStickyPopup;
  114. string Unicode = "";
  115. //private bool isHiddenAnnot = true;
  116. private bool isAddBookMark = true;
  117. private bool IsNoSelectMenu = false;
  118. private bool isRightMenuAddAnnot = false;
  119. private PopMenu HightAnnotPopMenu;
  120. private PopMenu FreeHandAnnotPopMenu;
  121. private PopMenu FreeTextAnnotPopMenu;
  122. private PopMenu StrickNoteAnnotPopMenu;
  123. private PopMenu ShapeAnnotPopMenu;
  124. private PopMenu LinkAnnotPopMenu;
  125. private PopMenu StampAnnotPopMenu;
  126. private PopMenu MultiAnnotPopMenu;
  127. #region 事件
  128. public DelegateCommand<CustomIconToggleBtn> MyToolsCommand { get; set; }
  129. private SnapshotEditMenuViewModel snapshotEditMenuViewModel = new SnapshotEditMenuViewModel();
  130. public SnapshotEditMenuViewModel SnapshotEditMenuViewModel { get => snapshotEditMenuViewModel; set => snapshotEditMenuViewModel = value; }
  131. public DelegateCommand<object> SetAddAnnotationCommand { get; set; }
  132. public DelegateCommand AddBookMarkCommand { get; set; }
  133. public DelegateCommand<object> HandCommand { get; set; }
  134. #region 注释 - 右键菜单
  135. //公共
  136. public DelegateCommand<object> AnnotDefaultValue_MenuCommand { get; set; }
  137. public DelegateCommand<object> AnnotColorPalette_MenuCommand { get; set; }
  138. public DelegateCommand<object> AnnotAddNoteText_MenuCommand { get; set; }
  139. //高亮、下划线、删除
  140. public DelegateCommand<object> HightAnnotCopyText_MenuCommand { get; set; }
  141. //手绘
  142. public DelegateCommand<object> FreeHandLineStyle_MenuCommand { get; set; }
  143. //文本
  144. public DelegateCommand<object> FreeTextFontFamily_MenuCommand { get; set; }
  145. public DelegateCommand<object> FreeTextAglin_MenuCommand { get; set; }
  146. //便签
  147. public DelegateCommand<object> StrikeNoteEditStrike_MenuCommand { get; set; }
  148. //形状
  149. public DelegateCommand<object> ShapeLineStyle_MenuCommand { get; set; }
  150. public DelegateCommand<object> ShapeLineDirect_MenuCommand { get; set; }
  151. //图章
  152. public DelegateCommand<object> StampExportPicture_MenuCommand { get; set; }
  153. //链接
  154. public DelegateCommand<object> Link_MenuCommand { get; set; }
  155. #endregion 注释 - 右键菜单
  156. #endregion 事件
  157. }
  158. public enum AddAnnotType
  159. {
  160. AnnotFreehand,//绘制
  161. AnnotFreeText = 1,//文本
  162. AnnotSticky,//便签
  163. AnnotSquare,//矩形
  164. AnnotCircle,//椭圆形
  165. AnnotArrow,//箭头
  166. AnnotLine,//直线
  167. AnnotLink,//链接
  168. AnnotStamp,//图章
  169. AnnotAutograph //签名
  170. }
  171. }