BackgroundDocumentContentViewModel.cs 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. using ComPDFKitViewer.PdfViewer;
  2. using PDF_Office.EventAggregators;
  3. using PDF_Office.Model;
  4. using PDF_Office.Model.EditTools.Background;
  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 System.Windows;
  13. namespace PDF_Office.ViewModels.EditTools.Background
  14. {
  15. public class BackgroundDocumentContentViewModel : BindableBase,INavigationAware
  16. {
  17. public IEventAggregator eventAggregator;
  18. public CPDFViewer PDFViewer;
  19. public BackgroundDocumentContentViewModel(IEventAggregator eventAggregator)
  20. {
  21. this.eventAggregator = eventAggregator;
  22. eventAggregator.GetEvent<SetBackgroundEvent>().Subscribe(SetBackground);
  23. }
  24. public void SetBackground( BackgroundInfo backgroundInfo)
  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. }