123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212 |
- using System;
- using System.Collections.Generic;
- using System.Diagnostics;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using PDF_Master.Helper;
- using PDF_Master.Model;
- using PDF_Master.Properties;
- using PDF_Master.Views.Dialog.ServiceDialog;
- using Prism.Commands;
- using Prism.Mvvm;
- using Prism.Regions;
- using Prism.Services.Dialogs;
- namespace PDF_Master.ViewModels.Dialog.ServiceDialog
- {
- public class RegisterDialogViewModel : BindableBase, IDialogAware
- {
- public IDialogService dialogs;
- public IRegionManager Region;
- public string Title => "注册窗口";
-
- public event Action<IDialogResult> RequestClose;
-
- private string _RegisterRegionName;
- public string RegisterRegionName
- {
- get { return _RegisterRegionName; }
- set { _RegisterRegionName = value; }
- }
- private string _registerEmail;
- public string RegisterEmail
- {
- get { return _registerEmail; }
- set { _registerEmail = value; }
- }
- private string _RegisterPassword;
- public string RegisterPassword
- {
- get { return _RegisterPassword; }
- set { _RegisterPassword = value; }
- }
- private string _TextUnlock;
- public string TextUnlock
- {
- get { return _TextUnlock; }
- set { _TextUnlock = value; }
- }
- private string _TextRegisteras;
- public string TextRegisteras
- {
- get { return _TextRegisteras; }
- set { _TextRegisteras = value; }
- }
- private string _TextEditPDF;
- public string TextEditPDF
- {
- get { return _TextEditPDF; }
- set { _TextEditPDF = value; }
- }
- private string _Textediting;
- public string Textediting
- {
- get { return _Textediting; }
- set { _Textediting = value; }
- }
- private string _TextConvert;
- public string TextConvert
- {
- get { return _TextConvert; }
- set { _TextConvert = value; }
- }
- private string _TextLimit10;
- public string TextLimit10
- {
- get { return _TextLimit10; }
- set { _TextLimit10 = value; }
- }
- private string _TextConvertPDF;
- public string TextConvertPDF
- {
- get { return _TextConvertPDF; }
- set { _TextConvertPDF = value; }
- }
- private string _TextOrganize;
- public string TextOrganize
- {
- get { return _TextOrganize; }
- set { _TextOrganize = value; }
- }
- private string _TextInsert;
- public string TextInsert
- {
- get { return _TextInsert; }
- set { _TextInsert = value; }
- }
- private string _TextSuch;
- public string TextSuch
- {
- get { return _TextSuch; }
- set { _TextSuch = value; }
- }
- private string _TextSubscribeNow;
- public string TextSubscribeNow
- {
- get { return _TextSubscribeNow; }
- set { _TextSubscribeNow = value; }
- }
- private string _TextMore;
- public string TextMore
- {
- get { return _TextMore; }
- set { _TextMore = value; }
- }
- public void Close()
- {
-
- RequestClose?.Invoke(new Prism.Services.Dialogs.DialogResult(ButtonResult.Cancel));
- }
- public bool CanCloseDialog()
- {
- return true;
- }
- public void OnDialogClosed()
- {
- }
- public void OnDialogOpened(IDialogParameters parameters)
- {
- if (ServiceHelper.IsConnectInternet() ==false)
- {
-
- RegionMan("NOInternetRegion");
-
-
- }
- else { RegionMan("RegisterRegion"); };
-
- }
- private void InitString()
- {
- TextUnlock = App.ServiceLoader.GetString("TextUnlock");
- TextRegisteras = App.ServiceLoader.GetString("TextRegisteras");
- TextEditPDF = App.ServiceLoader.GetString("TextEditPDF");
- Textediting = App.ServiceLoader.GetString("Textediting");
- TextConvert = App.ServiceLoader.GetString("TextConvert");
- TextLimit10 = App.ServiceLoader.GetString("TextLimit10");
- TextConvertPDF = App.ServiceLoader.GetString("TextConvertPDF");
- TextOrganize = App.ServiceLoader.GetString("TextOrganize");
- TextInsert = App.ServiceLoader.GetString("TextInsert");
- TextMore = App.ServiceLoader.GetString("TextMore");
- TextSuch = App.ServiceLoader.GetString("TextSuch");
- TextSubscribeNow = App.ServiceLoader.GetString("TextSubscribeNow");
- }
- public DelegateCommand LinkstoreCommand { get; set; }
- public DelegateCommand OpenIAPCommand { get; set; }
- RegisterDialogViewModel(IRegionManager regionManager, IDialogService dialogService)
- {
- LinkstoreCommand = new DelegateCommand(Linkstore);
- OpenIAPCommand = new DelegateCommand(OpenIAP);
- dialogs = dialogService;
- this.Region = regionManager;
- RegisterRegionName = Guid.NewGuid().ToString();
- InitString();
- }
- private void Linkstore()
- {
- Process.Start(new ProcessStartInfo("https://www.pdfreaderpro.com/windows/store/permanent"));
- }
- private void OpenIAP()
- {
- dialogs.ShowDialog(DialogNames.IAPCompareDialog);
- }
- public void RegionMan(string name)
- {
- NavigationParameters param = new NavigationParameters();
- param.Add("RegisterDialogViewModel", this);
- Region.RequestNavigate(RegisterRegionName, name,e=> {
- var r= e.Result; }, param);
- }
- }
- }
|