/// <summary> /// Register commands /// </summary> private void RegisterCommands() { CreateAccountCommand = new Command(async(p) => { IsBusy = true; try { // Log in and get access token var response = await KryptPadApi.CreateAccountAsync(Email, Password, ConfirmPassword); // The account was created await DialogHelper.ShowMessageDialogAsync("Your account has been successfully created."); // Go to login page NavigationHelper.Navigate(typeof(LoginPage), null); } catch (WebException ex) { // Something went wrong in the api await DialogHelper.ShowMessageDialogAsync(ex.Message); } catch (Exception ex) { // Failed await DialogHelper.ShowGenericErrorDialogAsync(ex); } IsBusy = false; }, CanSignUp); }