123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104 |
- using System;
- using System.Collections.Generic;
- 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; }
- }
-
- 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"); };
-
- }
- public DelegateCommand OpenIAPCommand { get; set; }
- RegisterDialogViewModel(IRegionManager regionManager, IDialogService dialogService)
- {
- OpenIAPCommand = new DelegateCommand(OpenIAP);
- dialogs = dialogService;
- this.Region = regionManager;
- RegisterRegionName = Guid.NewGuid().ToString();
- }
- 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);
- }
- }
- }
|