Skip to content

Instantly share code, notes, and snippets.

@scionwest
Created December 6, 2014 20:39
Show Gist options
  • Save scionwest/7b7d3849d5b6cb0b3030 to your computer and use it in GitHub Desktop.
Save scionwest/7b7d3849d5b6cb0b3030 to your computer and use it in GitHub Desktop.
ViewModel
private async Task ExecuteSignin()
{
this.IsSigningIn = true;
bool signinFailed = false;
string failureMesage = string.Empty;
try
{
User user = await this.userService.RetrieveUser(this.Username, this.Password);
this.navigationService.Navigate("Main", user);
}
catch (Exception ex)
{
signinFailed = true;
failureMesage = ex.Message;
}
if (signinFailed)
{
await this.alertService.ShowAsync(
"Signin Failure",
"Invalid username and/or password");
this.Password = string.Empty;
}
this.IsSigningIn = false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment