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; namespace PDF_Office.ViewModels.Form { public class ComboxPropertyViewModel : FormBaseVM, INavigationAware { #region 属性 #region 选项 //排序项目 private bool _isSortProject = false; public bool IsSortProject { get { return _isSortProject; } set { SetProperty(ref _isSortProject, value); } } //允许用户输入自定义文本 private bool _isAllowInOutText = false; public bool IsAllowInOutText { get { return _isAllowInOutText; } set { SetProperty(ref _isAllowInOutText, value); } } #endregion #endregion #region Command #endregion #region 变量 private CPDFViewer PDFViewer; private WidgetComboBoxArgs comboBoxArgs; #endregion #region 初始化 public ComboxPropertyViewModel() { 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) { comboBoxArgs = null; } public void OnNavigatedTo(NavigationContext navigationContext) { navigationContext.Parameters.TryGetValue(ParameterNames.PDFViewer, out PDFViewer); navigationContext.Parameters.TryGetValue("WidgetArgs", out comboBoxArgs); GetWidgeText(); } private void GetWidgeText() { if (comboBoxArgs == null) { comboBoxArgs = new WidgetComboBoxArgs(); } PDFViewer.SetMouseMode(MouseModes.FormEditTool); PDFViewer.SetToolParam(comboBoxArgs); } #endregion } }