using Prism.Commands; using Prism.Mvvm; using Prism.Regions; using Prism.Services.Dialogs; using System; namespace PDF_Office.ViewModels.Dialog.ServiceDialog { public class IAPCompareDialogViewModel : BindableBase,IDialogAware { public string Title => ""; public event Action RequestClose; private string _IAPRegionName; public string IAPRegionName { get { return _IAPRegionName; } set { _IAPRegionName = value; } } public bool CanCloseDialog() { return true; } public void OnDialogClosed() { } public void OnDialogOpened(IDialogParameters parameters) { } public DelegateCommand GoLoginCommand { get; set; } public DelegateCommand GoRegisterCommand { get; set; } IAPCompareDialogViewModel(IRegionManager regionManager, IDialogService dialogService) { IAPRegionName = Guid.NewGuid().ToString(); GoLoginCommand = new DelegateCommand(GoLogin); GoRegisterCommand = new DelegateCommand(GoRegisterd); } private void GoRegisterd() { RequestClose?.Invoke(new Prism.Services.Dialogs.DialogResult(ButtonResult.Cancel)); App.mainWindowViewModel.OpenLogin(); } private void GoLogin() { RequestClose?.Invoke(new Prism.Services.Dialogs.DialogResult(ButtonResult.Cancel)); App.mainWindowViewModel.OpenRegister(); } } }