/// <summary> /// Remove current account /// </summary> /// <param name="sender"></param> /// <param name="args"></param> public async void OnButtonDeleteClicked(object sender, EventArgs args) { try { //ask for confirmation bool answer = await DisplayAlert("Remove account", "Are you sure you want to remove your account? You can't undo this action.", "Yes", "No"); if (answer) { await accountViewModel.DeleteAccount(); SecureStorage.Remove("token"); await Navigation.PushAsync(new MainPage()); } } catch (Exception) { await DisplayAlert("Error", "Could not delete account", "Ok"); } }