BatesTemplateListContentViewModel.cs 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. using PDF_Office.EventAggregators;
  2. using Prism.Commands;
  3. using Prism.Events;
  4. using Prism.Mvvm;
  5. using Prism.Regions;
  6. using System;
  7. using System.Collections.Generic;
  8. using System.Linq;
  9. namespace PDF_Office.ViewModels.EditTools.Bates
  10. {
  11. public class BatesTemplateListContentViewModel : BindableBase, INavigationAware
  12. {
  13. public DelegateCommand EnterCreateCommand { get; set; }
  14. public IEventAggregator eventAggregator;
  15. public string Unicode = null;
  16. public BatesTemplateListContentViewModel(IEventAggregator eventAggregator)
  17. {
  18. this.eventAggregator = eventAggregator;
  19. Unicode = App.mainWindowViewModel.SelectedItem.Unicode;
  20. EnterCreateCommand = new DelegateCommand(EnterCreate);
  21. }
  22. public void EnterCreate()
  23. {
  24. this.eventAggregator.GetEvent<EnterTemplateListOrCreateEvent>().Publish(new EnumTemplateListOrCreateUnicode { Unicode = Unicode, Status = EnumTemplateListOrCreate.StatusCreate });
  25. }
  26. public bool IsNavigationTarget(NavigationContext navigationContext)
  27. {
  28. return true;
  29. }
  30. public void OnNavigatedFrom(NavigationContext navigationContext)
  31. {
  32. }
  33. public void OnNavigatedTo(NavigationContext navigationContext)
  34. {
  35. }
  36. }
  37. }