IAPCompareDialogViewModel.cs 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. using Prism.Commands;
  2. using Prism.Mvvm;
  3. using Prism.Regions;
  4. using Prism.Services.Dialogs;
  5. using System;
  6. namespace PDF_Office.ViewModels.Dialog.ServiceDialog
  7. {
  8. public class IAPCompareDialogViewModel : BindableBase,IDialogAware
  9. {
  10. public string Title => "";
  11. public event Action<IDialogResult> RequestClose;
  12. private string _IAPRegionName;
  13. public string IAPRegionName
  14. {
  15. get { return _IAPRegionName; }
  16. set { _IAPRegionName = value; }
  17. }
  18. public bool CanCloseDialog()
  19. {
  20. return true;
  21. }
  22. public void OnDialogClosed()
  23. {
  24. }
  25. public void OnDialogOpened(IDialogParameters parameters)
  26. {
  27. }
  28. public DelegateCommand GoLoginCommand { get; set; }
  29. public DelegateCommand GoRegisterCommand { get; set; }
  30. IAPCompareDialogViewModel(IRegionManager regionManager, IDialogService dialogService)
  31. {
  32. IAPRegionName = Guid.NewGuid().ToString();
  33. GoLoginCommand = new DelegateCommand(GoLogin);
  34. GoRegisterCommand = new DelegateCommand(GoRegisterd);
  35. }
  36. private void GoRegisterd()
  37. {
  38. RequestClose?.Invoke(new Prism.Services.Dialogs.DialogResult(ButtonResult.Cancel));
  39. App.mainWindowViewModel.OpenLogin();
  40. }
  41. private void GoLogin()
  42. {
  43. RequestClose?.Invoke(new Prism.Services.Dialogs.DialogResult(ButtonResult.Cancel));
  44. App.mainWindowViewModel.OpenRegister();
  45. }
  46. }
  47. }