RegisterOKRegionViewModel.cs 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. using PDF_Master.Helper;
  2. using PDF_Master.Model;
  3. using Prism.Commands;
  4. using Prism.Mvvm;
  5. using Prism.Regions;
  6. using Prism.Services.Dialogs;
  7. using System;
  8. using System.Collections.Generic;
  9. using System.Diagnostics;
  10. using System.Linq;
  11. using System.Text;
  12. using System.Threading.Tasks;
  13. using System.Windows;
  14. using System.Windows.Threading;
  15. namespace PDF_Master.ViewModels.Dialog.ServiceDialog
  16. {
  17. public class RegisterOKRegionViewModel : BindableBase, IDialogAware
  18. {
  19. public IDialogService dialogs;
  20. #region 文案
  21. private string _Text_regisuccess = "";
  22. public string Text_regisuccess
  23. {
  24. get { return _Text_regisuccess; }
  25. set
  26. {
  27. SetProperty(ref _Text_regisuccess, value);
  28. }
  29. }
  30. private string _Text_getstart = "";
  31. public event Action<IDialogResult> RequestClose;
  32. public string Text_getstart
  33. {
  34. get { return _Text_getstart; }
  35. set
  36. {
  37. SetProperty(ref _Text_getstart, value);
  38. }
  39. }
  40. private void InitString()
  41. {
  42. }
  43. #endregion
  44. public DelegateCommand LinkstoreCommand { get; set; }
  45. public DelegateCommand OpenIAPCommand { get; set; }
  46. public string Title => throw new NotImplementedException();
  47. public RegisterOKRegionViewModel(IRegionManager regionManager, IDialogService dialogService)
  48. {
  49. LinkstoreCommand = new DelegateCommand(Linkstore);
  50. OpenIAPCommand = new DelegateCommand(OpenIAP);
  51. dialogs = dialogService;
  52. InitString();
  53. }
  54. private void OpenIAP()
  55. {
  56. Close();
  57. dialogs.ShowDialog(DialogNames.IAPCompareDialog);
  58. }
  59. private void Linkstore()
  60. {
  61. Process.Start(new ProcessStartInfo("https://www.pdfreaderpro.com/windows/store/permanent"));
  62. }
  63. public void Close()
  64. {
  65. RequestClose?.Invoke(new Prism.Services.Dialogs.DialogResult(ButtonResult.Cancel));
  66. }
  67. public bool CanCloseDialog()
  68. {
  69. return true;
  70. }
  71. public void OnDialogClosed()
  72. {
  73. }
  74. public void OnDialogOpened(IDialogParameters parameters)
  75. {
  76. }
  77. }
  78. }