async Task resetRequestAsync() { if (!Validate()) { return; } User user = new User { UserName = _userName.Value, }; try { await _userService.ResetAsync <User>(user); await DialogService.ShowAlertAsync(AppResources.ForgotPassword, user.UserName, AppResources.OK); Username = new ValidatableObject <string>(); await NavigationService.PopAsync(); } catch (ServiceAuthenticationException e) { await DialogService.ShowAlertAsync(AppResources.GenericError, AppResources.Error, AppResources.OK); } catch (HttpRequestExceptionEx e) { await DialogService.ShowAlertAsync(AppResources.GenericError, AppResources.Error, AppResources.OK); } catch (Exception e) { await DialogService.ShowAlertAsync(AppResources.GenericError, AppResources.Error, AppResources.OK); } }
public ForgotPasswordViewModel(IIdentityService userService) { _userService = userService; _userName = new ValidatableObject <string>(); AddValidations(); }
public SignUpViewModel(IIdentityService userService) { _userService = userService; _userName = new ValidatableObject <string>(); _password = new ValidatableObject <string>(); AddValidations(); }
public AddViewModel(IMonitorService monitor) { _monitorService = monitor; _name = new ValidatableObject <string>(); _url = new ValidatableObject <string>(); addValidations(); }
async Task signUpRequestAsync() { if (!Validate()) { return; } User user = new User { UserName = _userName.Value, Password = _password.Value }; try { user = await _userService.SignUpAsync <User>(user); await DialogService.ShowAlertAsync(AppResources.SignUp, user.UserName, AppResources.OK); Username = new ValidatableObject <string>(); Password = new ValidatableObject <string>(); await NavigationService.NavigateToAsync <LoginViewModel>(user); } catch (ServiceAuthenticationException e) { await DialogService.ShowAlertAsync(AppResources.GenericError, AppResources.Error, AppResources.OK); } catch (HttpRequestExceptionEx e) { if (e.HttpCode == HttpStatusCode.Conflict) { await DialogService.ShowAlertAsync(AppResources.DuplicateEmail, "", AppResources.OK); } } catch (Exception e) { await DialogService.ShowAlertAsync(AppResources.GenericError, AppResources.Error, AppResources.OK); } }