SignPropertyViewModel.cs 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. using ComPDFKitViewer.AnnotEvent;
  2. using ComPDFKitViewer.PdfViewer;
  3. using PDF_Office.Model;
  4. using Prism.Mvvm;
  5. using Prism.Regions;
  6. using System;
  7. using System.Collections.Generic;
  8. using System.Linq;
  9. using System.Text;
  10. using System.Threading.Tasks;
  11. namespace PDF_Office.ViewModels.Form
  12. {
  13. public class SignPropertyViewModel : BindableBase, INavigationAware
  14. {
  15. #region 属性
  16. #endregion
  17. #region Command
  18. #endregion
  19. #region 变量
  20. private CPDFViewer PDFViewer;
  21. private WidgetSignArgs signArgs;
  22. #endregion
  23. #region 初始化
  24. public SignPropertyViewModel()
  25. {
  26. InitVariable();
  27. InitCommand();
  28. }
  29. private void InitVariable()
  30. {
  31. }
  32. private void InitCommand()
  33. {
  34. }
  35. #endregion
  36. #region 一般处理
  37. #endregion
  38. #region 外观处理
  39. #endregion
  40. #region 选项处理
  41. #endregion
  42. #region Navegation
  43. public bool IsNavigationTarget(NavigationContext navigationContext)
  44. {
  45. return true;
  46. }
  47. public void OnNavigatedFrom(NavigationContext navigationContext)
  48. {
  49. signArgs = null;
  50. }
  51. public void OnNavigatedTo(NavigationContext navigationContext)
  52. {
  53. navigationContext.Parameters.TryGetValue<CPDFViewer>(ParameterNames.PDFViewer, out PDFViewer);
  54. navigationContext.Parameters.TryGetValue<WidgetSignArgs>("WidgetArgs", out signArgs);
  55. GetWidgeText();
  56. }
  57. private void GetWidgeText()
  58. {
  59. if (signArgs == null)
  60. {
  61. signArgs = new WidgetSignArgs();
  62. }
  63. PDFViewer.SetMouseMode(MouseModes.FormEditTool);
  64. PDFViewer.SetToolParam(signArgs);
  65. }
  66. #endregion
  67. }
  68. }