123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Runtime.InteropServices;
- using System.Text;
- using System.Threading.Tasks;
- using PDF_Master.Helper;
- using PDF_Master.Properties;
- using Prism.Commands;
- using Prism.Mvvm;
- using Prism.Regions;
- using Prism.Services.Dialogs;
- namespace PDF_Master.ViewModels.Dialog.ServiceDialog
- {
- public class LoginDialogViewModel : BindableBase, IDialogAware
- {
- public IRegionManager Region;
- public string Title => "登录窗口";
- public event Action<IDialogResult> RequestClose;
- private bool _IsReset=false;
- public bool IsReset
- {
- get { return _IsReset; }
- set { _IsReset = value; }
- }
- private string _PasswordCode="";
- public string PasswordCode
- {
- get { return _PasswordCode; }
- set { _PasswordCode = value; }
- }
- private string _LoginRegionName;
- public string LoginRegionName
- {
- get { return _LoginRegionName; }
- set { _LoginRegionName = value; }
- }
- private string _LoginEmail;
- public string LoginEmail
- {
- get { return _LoginEmail; }
- set { _LoginEmail = value; }
- }
- private string _LoginPassword;
- public string LoginPassword
- {
- get { return _LoginPassword; }
- set { _LoginPassword = value; }
- }
- public bool CanCloseDialog()
- {
- return true;
- }
- public void OnDialogClosed()
- {
- }
- public void OnDialogOpened(IDialogParameters parameters)
- {
- if (ServiceHelper.IsConnectInternet() == false)
- {
- RegionMan("NOInternetRegion");
- }
- else { RegionMan("LoginRegion"); }
- }
- LoginDialogViewModel(IRegionManager regionManager, IDialogService dialogService)
- {
- this.Region = regionManager;
- LoginRegionName = Guid.NewGuid().ToString();
- }
- public void Close()
- {
-
- RequestClose?.Invoke(new Prism.Services.Dialogs.DialogResult(ButtonResult.Cancel));
- }
- public void RegionMan(string name)
- {
- NavigationParameters param = new NavigationParameters();
- param.Add("LoginDialogViewModel", this);
- param.Add("IsReset", IsReset);
- Region.RequestNavigate(LoginRegionName, name, e => {
- var r = e.Result;
- }, param);
- }
- }
- }
|