public SignInViewModel(IMvxNavigationService navigationService, IUserAccountService userAccountService, IDialogueService dialogueService) { _navigationService = navigationService; _userAccountService = userAccountService; _dialogueService = dialogueService; this.SignInCommand = ReactiveCommand.CreateFromTask(async() => { var result = await _userAccountService.AuthenticateUser(UserName, Password); if (result) { _dialogueService.ShowInformation("Great Success!!"); } }, this.WhenAnyValue( x => x.UserName, x => x.Password, (userName, password) => !string.IsNullOrEmpty(userName) && !string.IsNullOrEmpty(password))); this.CreateAccountCommand = ReactiveCommand.CreateFromTask(() => { return(_navigationService.Navigate <NewAccountViewModel>()); }); }
public void OnNext(Exception value) { //Handle Known exceptions if (KnownExceptionMap.Any(x => x == value.GetType().Name)) { _dialogs.ShowInformation(value.Message); } else if (value is ValidationException exception) { _dialogs.ShowValidationError(FormatFluentValidatorExceptions(exception)); } else { _dialogs.ShowError(value.Message); } }