using ComPDFKitViewer.AnnotEvent; using ComPDFKitViewer.PdfViewer; using PDF_Office.Model; using Prism.Mvvm; using Prism.Regions; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Media; namespace PDF_Office.ViewModels.Form { public class CheckBoxPropertyViewModel : FormBaseVM, INavigationAware { #region 属性 #region 选项 //导出值 private string _exportValue; public string ExportValue { get { return _exportValue; } set { SetProperty(ref _exportValue, value); } } //复选框默认为选中 private bool _isDefaultChecked = false; public bool IsDefaultChecked { get { return _isDefaultChecked; } set { SetProperty(ref _isDefaultChecked, value); } } #endregion #endregion #region Command #endregion #region 变量 private CPDFViewer PDFViewer; private WidgetCheckBoxArgs checkBoxArgs; #endregion #region 初始化 public CheckBoxPropertyViewModel() { InitVariable(); InitCommand(); } private void InitVariable() { } private void InitCommand() { } #endregion #region 一般处理 #endregion #region 外观处理 #endregion #region 选项处理 #endregion #region Navegation public bool IsNavigationTarget(NavigationContext navigationContext) { return true; } public void OnNavigatedFrom(NavigationContext navigationContext) { checkBoxArgs = null; } public void OnNavigatedTo(NavigationContext navigationContext) { navigationContext.Parameters.TryGetValue(ParameterNames.PDFViewer, out PDFViewer); navigationContext.Parameters.TryGetValue("WidgetArgs", out checkBoxArgs); GetWidgeText(); } private void GetWidgeText() { if (checkBoxArgs == null) { checkBoxArgs = new WidgetCheckBoxArgs(); } PDFViewer.SetMouseMode(MouseModes.FormEditTool); PDFViewer.SetToolParam(checkBoxArgs); } #endregion } }