123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181 |
- using ComPDFKitViewer.AnnotEvent;
- using ComPDFKitViewer.PdfViewer;
- using PDF_Office.CustomControl;
- using PDF_Office.ViewModels.PropertyPanel.AnnotPanel;
- using Prism.Commands;
- using Prism.Events;
- using Prism.Regions;
- using Prism.Services.Dialogs;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Media;
- namespace PDF_Office.ViewModels.Tools
- {
-
-
-
- public class AnnotPropertyPanel
- {
- public AnnotAttribEvent AnnotEvent { get; set; }
- public List<AnnotAttribEvent> AnnotEvents = new List<AnnotAttribEvent>();
- public AnnotHandlerEventArgs annot;
- public List<AnnotHandlerEventArgs> annotlists;
- public event EventHandler<Dictionary<AnnotArgsType, object>> DataChanged;
- public event EventHandler<Dictionary<AnnotArgsType, object>> AnnotTypeChanged;
- public event EventHandler<object> DefaultStored;
- public AnnotPropertyPanel()
- { }
-
-
-
-
-
- public void DataChangedInvoke(object sender, Dictionary<AnnotArgsType, object> keyValues)
- {
- DataChanged?.Invoke(sender, keyValues);
- }
- public void AnnotTypeChangedInvoke(object sender, Dictionary<AnnotArgsType, object> keyValues)
- {
- AnnotTypeChanged?.Invoke(sender, keyValues);
- }
- }
- public sealed partial class AnnotToolContentViewModel
- {
- #region 属性
- #region 注释工具
-
- private Brush highLightColor = new SolidColorBrush(Color.FromRgb(0xFF, 0xBB, 0x00));
- public Brush HighLightColor
- { get { return highLightColor; } set { SetProperty(ref highLightColor, value); } }
-
- private double highLightOpacity = 1;
- public double HighLightOpacity
- { get { return highLightOpacity; } set { SetProperty(ref highLightOpacity, value); } }
-
- private Brush underLine = new SolidColorBrush(Color.FromRgb(0xFF, 0xBB, 0x00));
- public Brush UnderLineColor
- { get { return underLine; } set { SetProperty(ref underLine, value); } }
-
- private double underLineOpacity = 1;
- public double UnderLineOpacity
- { get { return underLineOpacity; } set { SetProperty(ref underLineOpacity, value); } }
-
- private Brush squigglyColor = new SolidColorBrush(Color.FromRgb(0xFF, 0xBB, 0x00));
- public Brush SquigglyColor
- { get { return squigglyColor; } set { SetProperty(ref squigglyColor, value); } }
-
- private double squigglyOpacity = 1;
- public double SquigglyOpacity
- { get { return squigglyOpacity; } set { SetProperty(ref squigglyOpacity, value); } }
-
- private Brush strikeoutColor = new SolidColorBrush(Color.FromRgb(0xFF, 0xBB, 0x00));
- public Brush StrikeoutColor
- { get { return strikeoutColor; } set { SetProperty(ref strikeoutColor, value); } }
-
- private double strikeoutOpacity = 1;
- public double StrikeoutOpacity
- { get { return strikeoutOpacity; } set { SetProperty(ref strikeoutOpacity, value); } }
- private bool btnSelecttoolIsChecked = false;
- public bool BtnSelecttoolIsChecked
- {
- get { return btnSelecttoolIsChecked; }
- set
- {
- SetProperty(ref btnSelecttoolIsChecked, value);
- }
- }
- private bool btnLinkIsChecked = false;
- public bool BtnLinkIsChecked
- {
- get { return btnLinkIsChecked; }
- set
- {
- SetProperty(ref btnLinkIsChecked, value);
- }
- }
- private bool btnHandIsChecked = false;
- public bool BtnHandIsChecked
- {
- get { return btnHandIsChecked; }
- set
- {
- SetProperty(ref btnHandIsChecked, value);
- }
- }
- #endregion 注释工具
- #endregion 属性
- public string PropertyRegionName { get; set; }
- private IEventAggregator events;
- public IDialogService dialogs;
- public IRegionManager region;
- private CPDFViewer PDFViewer;
- private ViewContentViewModel viewContentViewModel;
- private AnnotPropertyPanel propertyPanel = new AnnotPropertyPanel();
- private Dictionary<string, AnnotArgsType> ToolExpandDict = new Dictionary<string, AnnotArgsType>();
- private bool isHiddenAnnot = true;
- private bool isAddBookMark = true;
- private bool isRightMenuAddAnnot = false;
- #region 事件
- public DelegateCommand<CustomIconToggleBtn> MyToolsCommand { get; set; }
- private SnapshotEditMenuViewModel snapshotEditMenuViewModel = new SnapshotEditMenuViewModel();
- public SnapshotEditMenuViewModel SnapshotEditMenuViewModel { get => snapshotEditMenuViewModel; set => snapshotEditMenuViewModel = value; }
- public DelegateCommand<object> SetAddAnnotationCommand { get; set; }
- #endregion 事件
- }
- public enum AddAnnotType
- {
- AnnotFreehand,
- AnnotFreeText = 1,
- AnnotSticky,
- AnnotSquare,
- AnnotCircle,
- AnnotArrow,
- AnnotLine,
- AnnotLink,
- AnnotStamp,
- AnnotAutograph
- }
- }
|