public virtual Task BackAsync() { if (isNavigating) { return(Task.CompletedTask); } isNavigating = true; return(NavigationHelper.BackAsync().ContinueWith((x) => isNavigating = false)); }
async Task DeleteContribution() { try { // Shouldn't be getting here anyway, so no need for a message. if (!Contribution.StartDate.IsWithinCurrentAwardPeriod()) { return; } // Ask for confirmation before deletion. var confirm = await DialogService.ConfirmAsync("Are you sure you want to delete this contribution? You cannot undo this.", Alerts.HoldOn, Alerts.OK, Alerts.Cancel); if (!confirm) { return; } var isDeleted = await MvpApiService.DeleteContributionAsync(Contribution); if (isDeleted) { // TODO: Pass back true to indicate it needs to refresh. await NavigationHelper.BackAsync().ConfigureAwait(false); } else { await DialogService.AlertAsync("Your contribution could not be deleted. Perhaps it was already deleted, or it took place in the previous award period?", Alerts.Error, Alerts.OK); } } catch (Exception ex) { AnalyticsService.Report(ex); await DialogService.AlertAsync(Alerts.UnexpectedError, Alerts.Error, Alerts.OK).ConfigureAwait(false); } }
async Task Back() { await NavigationHelper.BackAsync().ConfigureAwait(false); }
public async virtual Task Back() { await NavigationHelper.BackAsync().ConfigureAwait(false); }