WatermarkDocumentContentViewModel.cs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. using ComPDFKitViewer.PdfViewer;
  2. using PDF_Office.EventAggregators;
  3. using PDF_Office.Model.EditTools.Background;
  4. using PDF_Office.Model;
  5. using Prism.Commands;
  6. using Prism.Events;
  7. using Prism.Mvvm;
  8. using Prism.Regions;
  9. using System;
  10. using System.Collections.Generic;
  11. using System.Linq;
  12. using PDF_Office.Model.EditTools.Watermark;
  13. namespace PDF_Office.ViewModels.EditTools.Watermark
  14. {
  15. public class WatermarkDocumentContentViewModel : BindableBase
  16. {
  17. public IEventAggregator eventAggregator;
  18. public CPDFViewer PDFViewer;
  19. public WatermarkDocumentContentViewModel(IEventAggregator eventAggregator)
  20. {
  21. this.eventAggregator = eventAggregator;
  22. eventAggregator.GetEvent<SetWatermarkEvent>().Subscribe(SetWatermark);
  23. }
  24. public void SetWatermark(WatermarkInfo watermarkInfo)
  25. {
  26. }
  27. public bool IsNavigationTarget(NavigationContext navigationContext)
  28. {
  29. return true;
  30. }
  31. public void OnNavigatedFrom(NavigationContext navigationContext)
  32. {
  33. }
  34. public void OnNavigatedTo(NavigationContext navigationContext)
  35. {
  36. navigationContext.Parameters.TryGetValue<CPDFViewer>(ParameterNames.PDFViewer, out PDFViewer);
  37. }
  38. }
  39. }