/// <summary> /// Refreshs the table. /// </summary> /// <returns>The async.</returns> /// <param name="pullDownActivated">If set to <c>true</c> pull down activated.</param> /// <param name="forceProgressIndicator">If set to <c>true</c> force progress indicator.</param> private async Task RefreshAsync(bool pullDownActivated = false, bool forceProgressIndicator = false) { Task resultTask = theQuestionInfo.RefreshQuestions(); await UIUtilities.ShowIndeterminateProgressIfNecessary(resultTask, "Refreshing Questions...", pullDownActivated, forceProgressIndicator); TableView.ReloadData(); }
/// <summary> /// Interface to delete the question. /// </summary> /// <param name="questionItem">Question item.</param> public async void DeleteQuestion(QuestionItem questionItem) { try { Task deleteQuestion = theQuestionInfo.DeleteQuestion(questionItem); await UIUtilities.ShowIndeterminateProgressIfNecessary(deleteQuestion, string.Format("Deleting task: [{0}] ...", questionItem.QuestionText)); } finally { NavigationController.PopViewControllerAnimated(true); } }
/// <summary> /// Interface to save the question. /// </summary> /// <param name="questionItem">Question item.</param> public async void SaveQuestion(QuestionItem questionItem) { try { Task saveTask = theQuestionInfo.Save(questionItem); if (theQuestionInfo.CurrentUIMode == UIModes.Adding) { await UIUtilities.ShowIndeterminateProgressIfNecessary(saveTask, string.Format("Adding task: [{0}] ...", questionItem.QuestionText)); } else { await UIUtilities.ShowIndeterminateProgressIfNecessary(saveTask, string.Format("Updating task: [{0}] ...", questionItem.QuestionText)); } await RefreshAsync(); } finally { NavigationController.PopViewControllerAnimated(true); } }