RegisterOKRegionViewModel.cs 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. using PDF_Office.Helper;
  2. using Prism.Commands;
  3. using Prism.Mvvm;
  4. using Prism.Regions;
  5. using Prism.Services.Dialogs;
  6. using System;
  7. using System.Collections.Generic;
  8. using System.Linq;
  9. using System.Text;
  10. using System.Threading.Tasks;
  11. using System.Windows;
  12. using System.Windows.Threading;
  13. namespace PDF_Office.ViewModels.Dialog.ServiceDialog
  14. {
  15. public class RegisterOKRegionViewModel : BindableBase, INavigationAware
  16. {
  17. private static Guid myuuid = Guid.NewGuid();
  18. private string uuid = myuuid.ToString();
  19. private RegisterDialogViewModel RegisterDialogViewModel;
  20. public IDialogService dialogs;
  21. public bool IsNavigationTarget(NavigationContext navigationContext)
  22. {
  23. return true;
  24. }
  25. public void OnNavigatedFrom(NavigationContext navigationContext)
  26. {
  27. }
  28. public void OnNavigatedTo(NavigationContext navigationContext)
  29. {
  30. navigationContext.Parameters.TryGetValue<RegisterDialogViewModel>("RegisterDialogViewModel", out RegisterDialogViewModel);
  31. }
  32. public DelegateCommand RegisterGetStartCommand { get; set; }
  33. public DelegateCommand CloseDialogCommand { get; set; }
  34. public RegisterOKRegionViewModel(IRegionManager regionManager, IDialogService dialogService)
  35. {
  36. dialogs = dialogService;
  37. RegisterGetStartCommand = new DelegateCommand(RegisterGetStart);
  38. CloseDialogCommand = new DelegateCommand(CloseDialog);
  39. }
  40. private void CloseDialog()
  41. {
  42. RegisterDialogViewModel.Close();
  43. }
  44. private void RegisterGetStart()
  45. {
  46. RegisterDialogViewModel.Close();
  47. }
  48. }
  49. }