SetPasswordSuccessfullyTipViewModel.cs 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. using PDF_Office.EventAggregators;
  2. using Prism.Commands;
  3. using Prism.Events;
  4. using Prism.Mvvm;
  5. using Prism.Regions;
  6. using Prism.Services.Dialogs;
  7. using System;
  8. using System.Collections.Generic;
  9. using System.Linq;
  10. using System.Text;
  11. using System.Threading.Tasks;
  12. namespace PDF_Office.ViewModels.TipContent
  13. {
  14. public class SetPasswordSuccessfullyTipViewModel:BindableBase,INavigationAware
  15. {
  16. public string unicode = null;
  17. public IEventAggregator eventAggregator;
  18. public DelegateCommand CloseTipCommand { get; set; }
  19. public SetPasswordSuccessfullyTipViewModel(IEventAggregator eventAggregator)
  20. {
  21. this.eventAggregator = eventAggregator;
  22. unicode = App.mainWindowViewModel.SelectedItem.Unicode;
  23. CloseTipCommand = new DelegateCommand(CloseTip);
  24. }
  25. public void CloseTip()
  26. {
  27. this.eventAggregator.GetEvent<ShowTipEvent>().Publish(new ShowTipEventArgs() { enumTipKind = EnumTipKind.StatusNone, Unicode = unicode });
  28. }
  29. public bool IsNavigationTarget(NavigationContext navigationContext)
  30. {
  31. return true;
  32. }
  33. public void OnNavigatedFrom(NavigationContext navigationContext)
  34. {
  35. }
  36. public void OnNavigatedTo(NavigationContext navigationContext)
  37. {
  38. }
  39. }
  40. }