RegisterOKRegionViewModel.cs 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. using PDF_Master.Helper;
  2. using PDF_Master.Model;
  3. using PDF_Master.Properties;
  4. using Prism.Commands;
  5. using Prism.Mvvm;
  6. using Prism.Regions;
  7. using Prism.Services.Dialogs;
  8. using System;
  9. using System.Collections.Generic;
  10. using System.Diagnostics;
  11. using System.Linq;
  12. using System.Text;
  13. using System.Threading.Tasks;
  14. using System.Windows;
  15. using System.Windows.Threading;
  16. namespace PDF_Master.ViewModels.Dialog.ServiceDialog
  17. {
  18. public class RegisterOKRegionViewModel : BindableBase, IDialogAware
  19. {
  20. public IDialogService dialogs;
  21. public event Action<IDialogResult> RequestClose;
  22. #region 文案
  23. private string _Textregisuccess = "";
  24. public string Textregisuccess
  25. {
  26. get { return _Textregisuccess; }
  27. set
  28. {
  29. SetProperty(ref _Textregisuccess, value);
  30. }
  31. }
  32. private string _TextWelcome;
  33. public string TextWelcome
  34. {
  35. get { return _TextWelcome; }
  36. set { _TextWelcome = value; }
  37. }
  38. private string _TextPDF;
  39. public string TextPDF
  40. {
  41. get { return _TextPDF; }
  42. set { _TextPDF = value; }
  43. }
  44. private string _TextEnjoy;
  45. public string TextEnjoy
  46. {
  47. get { return _TextEnjoy; }
  48. set { _TextEnjoy = value; }
  49. }
  50. private string _TextOrsubscribe;
  51. public string TextOrsubscribe
  52. {
  53. get { return _TextOrsubscribe; }
  54. set { _TextOrsubscribe = value; }
  55. }
  56. private string _TextAIrobot;
  57. public string TextAIrobot
  58. {
  59. get { return _TextAIrobot; }
  60. set { _TextAIrobot = value; }
  61. }
  62. private string _TextUnlimited;
  63. public string TextUnlimited
  64. {
  65. get { return _TextUnlimited; }
  66. set { _TextUnlimited = value; }
  67. }
  68. private string _TextSaveNoWatermark;
  69. public string TextSaveNoWatermark
  70. {
  71. get { return _TextSaveNoWatermark; }
  72. set { _TextSaveNoWatermark = value; }
  73. }
  74. private string _BtnTextSubscribe;
  75. public string BtnTextSubscribe
  76. {
  77. get { return _BtnTextSubscribe; }
  78. set { _BtnTextSubscribe = value; }
  79. }
  80. private void InitString()
  81. {
  82. Textregisuccess = App.ServiceLoader.GetString("Text_regisuccess");
  83. TextWelcome = App.ServiceLoader.GetString("TextWelcome");
  84. TextPDF = App.ServiceLoader.GetString("TextPDF");
  85. TextEnjoy = App.ServiceLoader.GetString("TextEnjoy");
  86. TextOrsubscribe = App.ServiceLoader.GetString("TextOrsubscribe");
  87. TextAIrobot = App.ServiceLoader.GetString("TextAIrobot");
  88. TextUnlimited = App.ServiceLoader.GetString("TextUnlimited");
  89. TextSaveNoWatermark = App.ServiceLoader.GetString("TextSaveNoWatermark");
  90. BtnTextSubscribe = App.ServiceLoader.GetString("BtnTextSubscribe");
  91. }
  92. #endregion
  93. public DelegateCommand LinkstoreCommand { get; set; }
  94. public DelegateCommand OpenIAPCommand { get; set; }
  95. public string Title => throw new NotImplementedException();
  96. public RegisterOKRegionViewModel(IRegionManager regionManager, IDialogService dialogService)
  97. {
  98. LinkstoreCommand = new DelegateCommand(Linkstore);
  99. OpenIAPCommand = new DelegateCommand(OpenIAP);
  100. dialogs = dialogService;
  101. InitString();
  102. }
  103. private void OpenIAP()
  104. {
  105. Close();
  106. dialogs.ShowDialog(DialogNames.IAPCompareDialog);
  107. }
  108. private void Linkstore()
  109. {
  110. Process.Start(new ProcessStartInfo(ServiceHelper.WebHost+"/windows/store/master?email=" + Settings.Default.UserDate.Email));
  111. }
  112. public void Close()
  113. {
  114. RequestClose?.Invoke(new Prism.Services.Dialogs.DialogResult(ButtonResult.Cancel));
  115. }
  116. public bool CanCloseDialog()
  117. {
  118. return true;
  119. }
  120. public void OnDialogClosed()
  121. {
  122. }
  123. public void OnDialogOpened(IDialogParameters parameters)
  124. {
  125. }
  126. }
  127. }