ListBoxPropertyViewModel.cs 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  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 ListBoxPropertyViewModel : FormBaseVM, INavigationAware
  14. {
  15. #region 属性
  16. #region 选项
  17. //排序项目
  18. private bool _isSortProject = false;
  19. public bool IsSortProject
  20. {
  21. get { return _isSortProject; }
  22. set { SetProperty(ref _isSortProject, value); }
  23. }
  24. //多重选择的
  25. private bool _multipleSelection = false;
  26. public bool MultipleSelection
  27. {
  28. get { return _multipleSelection; }
  29. set { SetProperty(ref _multipleSelection, value); }
  30. }
  31. #endregion
  32. #endregion
  33. #region Command
  34. #endregion
  35. #region 变量
  36. private CPDFViewer PDFViewer;
  37. private WidgetListBoxArgs listBoxArgs;
  38. #endregion
  39. #region 初始化
  40. public ListBoxPropertyViewModel()
  41. {
  42. InitVariable();
  43. InitCommand();
  44. }
  45. private void InitVariable()
  46. {
  47. }
  48. private void InitCommand()
  49. {
  50. }
  51. #endregion
  52. #region 一般处理
  53. #endregion
  54. #region 外观处理
  55. #endregion
  56. #region 选项处理
  57. #endregion
  58. #region Navegation
  59. public bool IsNavigationTarget(NavigationContext navigationContext)
  60. {
  61. return true;
  62. }
  63. public void OnNavigatedFrom(NavigationContext navigationContext)
  64. {
  65. listBoxArgs = null;
  66. }
  67. public void OnNavigatedTo(NavigationContext navigationContext)
  68. {
  69. navigationContext.Parameters.TryGetValue<CPDFViewer>(ParameterNames.PDFViewer, out PDFViewer);
  70. navigationContext.Parameters.TryGetValue<WidgetListBoxArgs>("WidgetArgs", out listBoxArgs);
  71. GetWidgeText();
  72. }
  73. private void GetWidgeText()
  74. {
  75. if (listBoxArgs == null)
  76. {
  77. listBoxArgs = new WidgetListBoxArgs();
  78. }
  79. PDFViewer.SetMouseMode(MouseModes.FormEditTool);
  80. PDFViewer.SetToolParam(listBoxArgs);
  81. }
  82. #endregion
  83. }
  84. }