public static ChangePasswordDialogViewModel Create(Action requestClose, Func <IHavePassword, Task <bool> > requestAuthenticate) { ChangePasswordDialogViewModel result = new ChangePasswordDialogViewModel(); result.IsAsync = true; result.RequestClose = requestClose; result.RequestAuthenticateAsync = requestAuthenticate; return(result); }
private async Task ChangePassword(ChangePasswordDialogViewModel viewModel, object ownerWindow) { if (viewModel == null) { return; } try { this.RequestChangePassword?.Invoke(viewModel.Model); await DialogService?.ShowMessageAsync(null, "رمز عبور با موفقیت تغییر یافت", "پیغام", ownerWindow); } catch (Exception ex) { await DialogService?.ShowMessageAsync(null, ex.Message, "خطا", ownerWindow); } }