PDFEditVM.cs 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. using ComPDFKitViewer;
  2. using ComPDFKitViewer.PdfViewer;
  3. using Prism.Mvvm;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows;
  10. using System.Windows.Controls;
  11. using System.Windows.Input;
  12. namespace PDF_Office.ViewModels.PropertyPanel.PDFEdit
  13. {
  14. public class PDFEditVM: BindableBase
  15. {
  16. #region 变量
  17. protected PDFEditEvent TextEditEvent;
  18. protected CPDFViewer PDFViewer;
  19. #endregion
  20. #region 编辑PDF全局
  21. //多选时,选中的既是文本也是图像
  22. private bool _isSelectTextAndImg = false;
  23. public bool IsSelectTextAndImg { get { return _isSelectTextAndImg; } set { SetProperty(ref _isSelectTextAndImg, value); } }
  24. //平均对齐布局
  25. private bool _isLayoutAvgAlign = false;
  26. public bool IsLayoutAvgAlign { get { return _isLayoutAvgAlign; } set { SetProperty(ref _isLayoutAvgAlign, value); } }
  27. //对齐布局
  28. private bool _isLayoutAlign = false;
  29. public bool IsLayoutAlign { get { return _isLayoutAlign; } set { SetProperty(ref _isLayoutAlign, value); } }
  30. //是否为文本
  31. private bool _isTextEdit = true;
  32. public bool IsTextEdit { get { return _isTextEdit; } set { SetProperty(ref _isTextEdit, value); } }
  33. #endregion
  34. protected void SetPopMenuItem(MenuItem menu, object sender, ICommand command)
  35. {
  36. MenuItem menuItem = menu;
  37. menuItem.CommandTarget = (UIElement)sender;
  38. menuItem.Command = command;
  39. }
  40. }
  41. }