12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- using ComPDFKitViewer.PdfViewer;
- using PDF_Office.EventAggregators;
- using PDF_Office.Model;
- using Prism.Commands;
- using Prism.Events;
- using Prism.Mvvm;
- using Prism.Regions;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Windows;
- namespace PDF_Office.ViewModels.EditTools.Redaction
- {
- public class RedactionContentViewModel : BindableBase,INavigationAware
- {
- public IEventAggregator eventAggregator;
- public IRegionManager redactionRegion;
- private CPDFViewer PDFViewer;
- public string RedactionDocumentRegionName { get; set; }
- public string RedactionBottomBarRegionName { get; set; }
- public string RedactionDocumentName = "RedactionDocumentContent";
- public string Unicode = null;
- public DelegateCommand CloseEditToolCommand { get; set; }
- public RedactionContentViewModel(IRegionManager regionManager, IEventAggregator eventAggregator)
- {
- this.redactionRegion = regionManager;
- this.eventAggregator = eventAggregator;
- RedactionDocumentRegionName = Guid.NewGuid().ToString();
- Unicode = App.mainWindowViewModel.SelectedItem.Unicode;
- CloseEditToolCommand = new DelegateCommand(CloseEditTool);
- }
- public void CloseEditTool()
- {
- this.eventAggregator.GetEvent<CloseEditToolEvent>().Publish(new EnumCloseModeUnicode { Unicode = this.Unicode, Status = EnumCloseMode.StatusCancel });
- }
- public bool IsNavigationTarget(NavigationContext navigationContext)
- {
- return true;
- }
- public void OnNavigatedFrom(NavigationContext navigationContext)
- {
- }
- public void OnNavigatedTo(NavigationContext navigationContext)
- {
- navigationContext.Parameters.TryGetValue<CPDFViewer>(ParameterNames.PDFViewer, out PDFViewer);
- NavigationParameters param = new NavigationParameters();
- param.Add(ParameterNames.PDFViewer, PDFViewer);
- redactionRegion.RequestNavigate(RedactionDocumentRegionName, RedactionDocumentName, param);
- }
- }
- }
|