123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647 |
- using ComPDFKitViewer.AnnotEvent;
- using ComPDFKitViewer.PdfViewer;
- using PDF_Office.Model;
- using Prism.Commands;
- 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;
- using System.Windows.Controls;
- using PDF_Office.ViewModels.Tools;
- using ComPDFKitViewer;
- using PDF_Office.Helper;
- using PDF_Office.Properties;
- using PDFSettings;
- using System.Windows.Media;
- using ComPDFKit.PDFDocument.Action;
- using ComPDFKit.PDFDocument;
- using System.Diagnostics;
- using ComPDFKit.PDFAnnotation;
- using PDF_Office.ViewModels.BOTA;
- using PDF_Office.Views.BOTA;
- using System.Windows.Forms;
- using Control = System.Windows.Controls.Control;
- using Microsoft.Office.Interop.Word;
- using Point = System.Windows.Point;
- namespace PDF_Office.ViewModels.FillAndSign
- {
- public class FillAndSignContentViewModel : BindableBase, INavigationAware
- {
- #region
- private CPDFViewer PDFViewer;
- private AnnotPropertyPanel propertyPanel = new AnnotPropertyPanel();
- private ViewContentViewModel viewContentViewModel;
- private bool isRightMenuAddAnnot = false;
- private List<List<Point>> ShapePoints = new List<List<Point>>();
- private string Shape = "HookShape";
-
- private IRegionManager regions { get; set; }
- private Dictionary<string, AnnotArgsType> ToolExpandDict = new Dictionary<string, AnnotArgsType>();
- public Brush SelectColor=new SolidColorBrush(Colors.GreenYellow);
- public double FillOpacity = 1;
- public double LineWidth = 1;
- #endregion
- #region Command
- public DelegateCommand<RoutedEventArgs> CheckCommand { get; set; }
- /// <summary>
- /// 按钮名称和属性面板映射字典
- /// </summary>
- public Dictionary<string, string> btnToProperty = new Dictionary<string, string>();
- #endregion
- public FillAndSignContentViewModel(IRegionManager regionManager)
- {
- regions = regionManager;
- CheckCommand = new DelegateCommand<RoutedEventArgs>(CheckedEvent);
- ToolExpandDict.Add("Freetext", AnnotArgsType.AnnotFreeText);
- InitDictionary();
- }
- private void CheckedEvent(RoutedEventArgs e)
- {
- var control = e.OriginalSource as Control;
- //NavigateToProperty(control.Name);
- //不创建注释,属于注释模板
- bool isTemplateAnnot = false;
- bool isSnapshotEdit = false;
- AnnotHandlerEventArgs annotArgs = null;
- var tag = control.Name;
- FindAnnotTypeKey(control.Name, ref annotArgs);
- if (control.Name == "RbtnSign") { isTemplateAnnot = true; }
- if (tag == "SnapshotEdit")
- {
- isSnapshotEdit = true;
- }
- else if (tag == "Signature" || tag == "Stamp")
- {
- isTemplateAnnot = true;
- }
- if (annotArgs != null)
- {
- annotArgs.Author = Settings.Default.AppProperties.Description.Author;
- PDFViewer.SetMouseMode(MouseModes.AnnotCreate);
- PDFViewer.SetToolParam(annotArgs);
- isRightMenuAddAnnot = false;
- }
- //当不是注释模板,且无创建注释时,属性面板显示为空内容
- if (isTemplateAnnot == false && annotArgs == null)
- {
- PDFViewer.SetMouseMode(MouseModes.PanTool);
- viewContentViewModel.SelectedPrpoertyPanel("PropertyPanelContent", null);
- }
- else
- {
- if (isSnapshotEdit == true)
- {
- ShowPropertyPanel(false);
- isSnapshotEdit = false;
- }
- else
- {
- ShowPropertyPanel(true);
- }
- }
- }
- //注释工具
- private void FindAnnotTypeKey(string tag, ref AnnotHandlerEventArgs annotArgs, bool isRightMenuAdd = false)
- {
- switch (tag)
- {
- case "RbtnDate":
- case "RbtnText"://文本
- annotArgs = GetFreetext();
- break;
- case "Freetext"://文本
- annotArgs = GetFreetext();
- break;
- case "RbtnSign"://签名
- annotArgs = GetSignature();
- PDFViewer.SetMouseMode(MouseModes.PanTool);//清空其他注释
- break;
- case "RbtnTick"://勾
- Shape = "HookShape";
- ShapePoints =new List<List<Point>> { new List<Point> { new Point(0.599976,7.0286), new Point(5.57775,11.8), new Point(13.4,1.40002)} };
- annotArgs = GetStamp();
- break;
- case "RbtnFork"://叉
- Shape = "ForkShape";
- ShapePoints = new List<List<Point>> { new List<Point> { new Point(3.19995, 3.20001), new Point(12.8, 12.8) } ,new List<Point> { new Point(12.8, 3.20001), new Point(3.20005, 12.8) }};
- annotArgs = GetStamp();
- break;
- case "RbtnRectangle"://矩形
- Shape = "RectShape";
- ShapePoints = new List<List<Point>> { new List<Point> { new Point(0, 5), new Point(28, 5),new Point(28,27),new Point(0,27) , new Point(0, 5) } };
- annotArgs = GetStamp();
- break;
- case "RbtnLine"://下划线
- Shape = "LineShape";
- ShapePoints = new List<List<Point>> { new List<Point> { new Point(12, 10), new Point(36, 10) } };
- annotArgs = GetStamp();
- break;
- case "RbtnPoint":
- Shape = "DotShape";
- ShapePoints = new List<List<Point>> { new List<Point> { new Point(0, 0), new Point(2, 2) }, new List<Point> { new Point(2, 0), new Point(0,2 ) } };
- annotArgs = GetStamp();
- break;
- default://图章
- break;
- }
- }
- /// <summary>
- /// 签名
- /// </summary>
- /// <returns></returns>
- private AnnotHandlerEventArgs GetSignature()
- {
- AddToPropertyPanel("SignatureAnnotProperty");
- return null;
- }
- /// <summary>
- /// 图章
- /// </summary>
- /// <returns></returns>
- private AnnotHandlerEventArgs GetStamp()
- {
- StampAnnotArgs stampAnnotArgs = new StampAnnotArgs();
- stampAnnotArgs.SetInkData(ShapePoints, LineWidth, (SelectColor as SolidColorBrush).Color);
- //PDFViewer.SetMouseMode(MouseModes.AnnotCreate);
- //PDFViewer.SetToolParam(stampArgs);
- //StampAnnotArgs stampAnnotArgs = new StampAnnotArgs();
- //stampAnnotArgs.Opacity = 1;
- //stampAnnotArgs.StampText = "APPROVED";
- //stampAnnotArgs.Type = StampType.STANDARD_STAMP;
- // stampAnnotArgs.Type = StampType.STANDARD_STAMP;
- Dictionary<AnnotAttrib, object> annotAttribsList = new Dictionary<AnnotAttrib, object>();
- annotAttribsList[AnnotAttrib.Transparency] = stampAnnotArgs.Opacity;
- DefaultAnnotProperty annotProperty = SettingHelper.GetAnnotDefaultProperty(AnnotArgsType.AnnotStamp);
- List<AnnotHandlerEventArgs> stampAnnotArgsList = new List<AnnotHandlerEventArgs>();
- if (stampAnnotArgs != null)
- stampAnnotArgsList.Add(stampAnnotArgs);
- AddToPropertyPanel("ShapFillProperty", "", stampAnnotArgsList, annotAttribsList);
- return stampAnnotArgs;
- }
- public void SetStamp()
- {
- StampAnnotArgs stampAnnotArgs = new StampAnnotArgs();
- stampAnnotArgs.SetInkData(ShapePoints, LineWidth, (SelectColor as SolidColorBrush).Color);
- //PDFViewer.SetMouseMode(MouseModes.AnnotCreate);
- //PDFViewer.SetToolParam(stampArgs);
- //StampAnnotArgs stampAnnotArgs = new StampAnnotArgs();
- //stampAnnotArgs.Opacity = 1;
- //stampAnnotArgs.StampText = "APPROVED";
- //stampAnnotArgs.Type = StampType.STANDARD_STAMP;
- stampAnnotArgs.Opacity = FillOpacity;
- Dictionary<AnnotAttrib, object> annotAttribsList = new Dictionary<AnnotAttrib, object>();
- annotAttribsList[AnnotAttrib.Transparency] = stampAnnotArgs.Opacity;
- DefaultAnnotProperty annotProperty = SettingHelper.GetAnnotDefaultProperty(AnnotArgsType.AnnotStamp);
- List<AnnotHandlerEventArgs> stampAnnotArgsList = new List<AnnotHandlerEventArgs>();
- if (stampAnnotArgs != null)
- stampAnnotArgsList.Add(stampAnnotArgs);
- AddToPropertyPanel("ShapFillProperty", "", stampAnnotArgsList, annotAttribsList);
- bool isTemplateAnnot = false;
- bool isSnapshotEdit = false;
- AnnotHandlerEventArgs annotArgs = stampAnnotArgs;
- if (annotArgs != null)
- {
- annotArgs.Author = Settings.Default.AppProperties.Description.Author;
- PDFViewer.SetMouseMode(MouseModes.AnnotCreate);
- PDFViewer.SetToolParam(annotArgs);
- isRightMenuAddAnnot = false;
- }
- //当不是注释模板,且无创建注释时,属性面板显示为空内容
- if (isTemplateAnnot == false && annotArgs == null)
- {
- PDFViewer.SetMouseMode(MouseModes.PanTool);
- viewContentViewModel.SelectedPrpoertyPanel("PropertyPanelContent", null);
- }
- else
- {
- if (isSnapshotEdit == true)
- {
- ShowPropertyPanel(false);
- isSnapshotEdit = false;
- }
- else
- {
- ShowPropertyPanel(true);
- }
- }
- }
- /// <summary>
- /// 文本
- /// </summary>
- /// <param name="selectedfreetextArgs"></param>
- /// <returns></returns>
- private AnnotHandlerEventArgs GetFreetext(List<AnnotHandlerEventArgs> selectedArgs = null)
- {
- Dictionary<AnnotAttrib, object> annotAttribsList = new Dictionary<AnnotAttrib, object>();
- FreeTextAnnotArgs freetextArgs = null;
- TextAlignment textAlignment;
- if (selectedArgs == null || selectedArgs.Count == 0)
- {
- freetextArgs = new FreeTextAnnotArgs();
- freetextArgs.Align = TextAlignment.Left;
- freetextArgs.BgColor = Colors.Transparent;
- freetextArgs.FontFamily = new FontFamily(Settings.Default.AppProperties.Annotate.TextFontFamaily);
- freetextArgs.FontColor = Colors.Black;
- freetextArgs.FontSize = 14;
- freetextArgs.Transparency = 1;
- freetextArgs.LineColor = Colors.Black;
- freetextArgs.LineWidth = 0;
- freetextArgs.TextContent = string.Empty;
- DefaultAnnotProperty annotProperty = SettingHelper.GetAnnotDefaultProperty(AnnotArgsType.AnnotFreeText);
- if (annotProperty != null)
- {
- freetextArgs.Align = annotProperty.TextAlign;
- freetextArgs.BgColor = annotProperty.BackgroundColor;
- freetextArgs.FontFamily = new FontFamily(annotProperty.FontFamily);
- freetextArgs.FontColor = annotProperty.ForgoundColor;
- freetextArgs.FontSize = annotProperty.FontSize;
- freetextArgs.Transparency = annotProperty.Opacity;
- freetextArgs.LineColor = annotProperty.BorderColor;
- freetextArgs.LineWidth = annotProperty.Thickness;
- freetextArgs.TextContent = annotProperty.NoteText;
- freetextArgs.FontWeight = annotProperty.FontWeight;
- freetextArgs.FontStyle = annotProperty.FontStyle;
- }
- int align = (int)Settings.Default.AppProperties.Annotate.TextAlign;
- if (align == 0)
- textAlignment = TextAlignment.Left;
- else if (align == 1)
- textAlignment = TextAlignment.Center;
- else
- textAlignment = TextAlignment.Right;
- if (freetextArgs != null)
- {
- selectedArgs = new List<AnnotHandlerEventArgs>();
- selectedArgs.Add(freetextArgs);
- }
- }
- else
- {
- freetextArgs = selectedArgs[0] as FreeTextAnnotArgs;
- textAlignment = freetextArgs.Align;
- }
- annotAttribsList[AnnotAttrib.Color] = freetextArgs.LineColor;
- annotAttribsList[AnnotAttrib.FillColor] = freetextArgs.BgColor;
- annotAttribsList[AnnotAttrib.Thickness] = freetextArgs.LineWidth;
- annotAttribsList[AnnotAttrib.Transparency] = freetextArgs.Transparency;
- annotAttribsList[AnnotAttrib.FontColor] = freetextArgs.FontColor;
- annotAttribsList[AnnotAttrib.FontSize] = freetextArgs.FontSize;
- annotAttribsList[AnnotAttrib.FontFamily] = freetextArgs.FontFamily;
- annotAttribsList[AnnotAttrib.FontStyle] = freetextArgs.FontStyle;
- annotAttribsList[AnnotAttrib.FontWeight] = freetextArgs.FontWeight;
- annotAttribsList[AnnotAttrib.TextAlign] = textAlignment;
- annotAttribsList[AnnotAttrib.NoteText] = freetextArgs.TextContent;
- AddToPropertyPanel("FreetextAnnotProperty", "Freetext", selectedArgs, annotAttribsList);
- return freetextArgs;
- }
- /// <summary>
- /// 导航到同一个注释xaml时,需要区分某个注释;比如高亮、删除线、下划线
- /// </summary>
- /// <param name="viewContent">对应的注释面板</param>
- /// <param name="toolTag">导航到同一个注释xaml时,需要区分某个注释;比如高亮、删除线、下划线</param>
- /// <param name="annot">注释</param>
- /// <param name="annotAttribsList">更改注释属性的键值对,更改值后会自动记录undoRedo容器里</param>
- private void AddToPropertyPanel(string viewContent, string toolTag = null, List<AnnotHandlerEventArgs> annots = null, Dictionary<AnnotAttrib, object> annotAttribsList = null, AnnotAttribEvent annotAttribEvent = null,bool isUpData=false)
- {
- if (annots != null)
- {
- propertyPanel.annotlists = annots;
- propertyPanel.annot = annots[0];
- }
- else
- {
- propertyPanel.annotlists = null;
- propertyPanel.annot = null;
- }
- if (annotAttribsList != null)
- {
- if (annots.Count > 1)
- {
- if (propertyPanel.AnnotEvents == null)
- propertyPanel.AnnotEvents = new List<AnnotAttribEvent>();
- propertyPanel.AnnotEvents.Clear();
- foreach (var itemAnnot in annots)
- {
- var eventitem = AnnotAttribEvent.GetAnnotAttribEvent(itemAnnot, annotAttribsList);
- propertyPanel.AnnotEvents.Add(eventitem);
- }
- }
- propertyPanel.AnnotEvent = AnnotAttribEvent.GetAnnotAttribEvent(annots[0], annotAttribsList);
- if (annots[0] is LinkAnnotArgs && annotAttribEvent != null)
- {
- propertyPanel.AnnotEvent = annotAttribEvent;
- }
- }
-
- if (string.IsNullOrEmpty(viewContent) == false)
- {
- if (isUpData) { return; }
- if (viewContent == "ShapFillProperty") { NavigateToProperty(viewContent, propertyPanel); return; }
- viewContentViewModel.SelectedPrpoertyPanel(viewContent, propertyPanel);
- }
-
- }
- private void NavigateToProperty(string btnName, AnnotPropertyPanel annotPropertyPanel)
- {
- NavigationParameters values = new NavigationParameters();
- values.Add(ParameterNames.PDFViewer, PDFViewer);
- values.Add(ParameterNames.PropertyPanelContentViewModel, annotPropertyPanel);
- values.Add("Shape", Shape);
- values.Add("FillAndSignContentViewModel", this);
- regions.RequestNavigate(RegionNames.PropertyRegionName,btnName,values);
- viewContentViewModel.IsPropertyOpen = true;
- }
- /// <summary>
- /// 初始化按钮名称-属性面板字典
- /// </summary>
- private void InitDictionary()
- {
- btnToProperty["RbtnText"] = "TextFillProperty";
- btnToProperty["RbtnTick"] = "ShapFillProperty";
- btnToProperty["RbtnFork"] = "ShapFillProperty";
- btnToProperty["RbtnRectangle"] = "ShapFillProperty";
- btnToProperty["RbtnLine"] = "ShapFillProperty";
- btnToProperty["RbtnPoint"] = "ShapFillProperty";
- btnToProperty["RbtnDate"] = "DateFillProperty";
- btnToProperty["RbtnSign"] = "";
- }
- private void BindingPDFViewerHandler()
- {
- //来自PDFViewer的响应事件
- if (PDFViewer != null)
- {
- //PDFViewer.AnnotActiveHandler -= PDFViewer_AnnotActiveHandler;
- //PDFViewer.AnnotActiveHandler += PDFViewer_AnnotActiveHandler;
- }
- }
- private void UnBindingPDFViewerHandler()
- {
- if (PDFViewer != null)
- { /*PDFViewer.AnnotActiveHandler += PDFViewer_AnnotActiveHandler; */}
- }
- //选中和非选中注释,右键菜单
- //private void PDFViewer_AnnotActiveHandler(object sender, AnnotAttribEvent e)
- //{
- // if (e != null)
- // {
- // var annot = e.AnnotItemsList[0];
- // if (annot != null)
- // {
- // if (e.AnnotItemsList.Count == 1)
- // {
- // //IsAnnotCreateReset:是否为创建注释的状态
- // if (e.IsAnnotCreateReset == false)
- // {
- // GetSelectedAnnots(e);
- // //记录这次选中的注释,之后创建注释会跟随上次选中注释的属性值
- // PDFViewer.SetToolParam(annot);
- // }
- // else
- // {
- // //TODO: 设计已重新调整为(仅限高亮注释):修改注释后,会作用到之后添加的注释中。因此先把此逻辑“创建注释后,会自动回到默认值”注释掉
- // if (annot.EventType != AnnotArgsType.AnnotStrikeout &&
- // annot.EventType != AnnotArgsType.AnnotUnderline &&
- // annot.EventType != AnnotArgsType.AnnotHighlight &&
- // annot.EventType != AnnotArgsType.AnnotSquiggly &&
- // annot.EventType != AnnotArgsType.AnnotLink &&
- // annot.EventType != AnnotArgsType.AnnotFreehand &&
- // annot.EventType != AnnotArgsType.AnnotSticky
- // )
- // {
- // if (ToolExpandDict.ContainsValue(e.AnnotItemsList[0].EventType))
- // {
- // foreach (var item in ToolExpandDict)
- // {
- // if (item.Value == e.AnnotItemsList[0].EventType)
- // {
- // annot = null;//新建注释时,回到默认值
- // FindAnnotTypeKey(item.Key, ref annot);
- // break;
- // }
- // }
- // }
- // }
- // //else
- // //PDFViewer.SetToolParam(annot);
- // //设计重新调整,阅读页空白处,右键菜单,添加链接,和pro mac一样的效果,不显示属性栏
- // if (isRightMenuAddAnnot)
- // {
- // ShowPropertyPanel(false);
- // }
- // else
- // {
- // ShowPropertyPanel();
- // }
- // }
- // }
- // else
- // {
- // bool isDifferentAnnotTyle = false;
- // var lastAnnot = annot;
- // foreach (var item in e.AnnotItemsList)
- // {
- // if (lastAnnot.EventType != item.EventType)
- // {
- // if (isShapAnnot(annot) == true && isShapAnnot(item) == true)
- // {
- // lastAnnot = item;
- // continue;
- // }
- // lastAnnot = item;
- // isDifferentAnnotTyle = true;
- // break;
- // }
- // }
- // if (isDifferentAnnotTyle)
- // viewContentViewModel.SelectedPrpoertyPanel("PropertyPanelContent", null);
- // else
- // GetSelectedAnnots(e);
- // }
- // }
- // }
- // else
- // {
- // viewContentViewModel.SelectedPrpoertyPanel("PropertyPanelContent", null);
- // }
- //}
- //private void PDFViewer_AnnotEditHandler(object sender, List<AnnotEditEvent> e)
- //{
- // if (e != null && e.Count > 0)
- // {
- // for (int i = 0; i < e.Count; i++)
- // {
- // AnnotEditEvent editEvent = e[i];
- // switch (editEvent.EditAction)
- // {
- // case ActionType.Add:
- // // bool isTabItemAnnotation = IsBOTATabItemShow(out BOTAContentViewModel bOTAContentViewModel, out BOTAContent bOTAContent, "TabItemAnnotation");
- // if (viewContentViewModel.OpenBOTA == true && isTabItemAnnotation == true)
- // {
- // AnnotationContentViewModel viewModel = GetAnnotationContentViewModel(bOTAContentViewModel);
- // if (viewModel != null)
- // {
- // int pageindex = editEvent.PageIndex;
- // int annotindex = editEvent.AnnotIndex;
- // viewModel.UpdateAddedAnnot(pageindex, annotindex);
- // }
- // }
- // break;
- // case ActionType.Del:
- // //isTabItemAnnotation = IsBOTATabItemShow(out bOTAContentViewModel, out bOTAContent, "TabItemAnnotation");
- // if (isTabItemAnnotation)
- // {
- // AnnotationContentViewModel viewModel = GetAnnotationContentViewModel(bOTAContentViewModel);
- // if (viewModel != null)
- // {
- // int pageindex = editEvent.PageIndex;
- // int annotindex = editEvent.AnnotIndex;
- // viewModel.UpdateModifiedAnnot(pageindex, annotindex, true);
- // }
- // }
- // break;
- // case ActionType.Modify:
- // isTabItemAnnotation = IsBOTATabItemShow(out bOTAContentViewModel, out bOTAContent, "TabItemAnnotation");
- // if (bOTAContent.TabItemAnnotation.IsSelected)
- // {
- // AnnotationContentViewModel viewModel = GetAnnotationContentViewModel(bOTAContentViewModel);
- // if (viewModel != null)
- // {
- // int pageindex = editEvent.PageIndex;
- // int annotindex = editEvent.AnnotIndex;
- // viewModel.UpdateModifiedAnnot(pageindex, annotindex, false);
- // }
- // }
- // break;
- // case ActionType.TextEdit:
- // break;
- // default:
- // break;
- // }
- // }
- // }
- //}
- private bool isShapAnnot(AnnotHandlerEventArgs annot)
- {
- if (annot.EventType == AnnotArgsType.AnnotCircle ||
- annot.EventType == AnnotArgsType.AnnotSquare ||
- annot.EventType == AnnotArgsType.AnnotLine
- )
- {
- return true;
- }
- else
- {
- return false;
- }
- }
- private void GetSelectedAnnots(AnnotAttribEvent e)
- {
- var annot = e.AnnotItemsList[0];
- switch (annot.EventType)
- {
- case AnnotArgsType.AnnotFreeText:
- GetFreetext(e.AnnotItemsList);
- break;
- }
- }
- private void ShowPropertyPanel(bool show = true)
- {
- viewContentViewModel.IsPropertyOpen = show;
- }
- #region Navigation
- public bool IsNavigationTarget(NavigationContext navigationContext)
- {
- return true;
- }
- public void OnNavigatedFrom(NavigationContext navigationContext)
- {
- UnBindingPDFViewerHandler();
- }
- public void OnNavigatedTo(NavigationContext navigationContext)
- {
- navigationContext.Parameters.TryGetValue<ViewContentViewModel>(ParameterNames.ViewContentViewModel, out viewContentViewModel);
- navigationContext.Parameters.TryGetValue<CPDFViewer>(ParameterNames.PDFViewer, out PDFViewer);
- BindingPDFViewerHandler();
- }
- #endregion
- }
- }
|