public async Task DeleteFeedback(Feedback feedback) { if (IsBusy) { return; } IsBusy = true; var showAlert = false; try { await dataStore.RemoveFeedbackAsync(feedback); Feedbacks.Remove(feedback); Sort(); } catch (Exception ex) { showAlert = true; Xamarin.Insights.Report(ex); } finally { IsBusy = false; } if (showAlert) { await page.DisplayAlert("Uh Oh :(", "Unable to delete feedback.", "OK"); } }
public void RemoveItem(Item item) { foreach (Feedback f in item.Feedbacks) { Feedbacks.Remove(f); FeedbacksDic[f.User.Id].Remove(f.Item.Id); if (f.User.Feedbacks.Count == 0) { Users.Remove(f.User.Id); } } Items.Remove(item.Id); }
public void RemoveFeedback(Feedback f) { f.User.Feedbacks.Remove(f); f.Item.Feedbacks.Remove(f); Feedbacks.Remove(f); FeedbacksDic[f.User.Id].Remove(f.Item.Id); if (f.User.Feedbacks.Count == 0) { Users.Remove(f.User.Id); } if (f.Item.Feedbacks.Count == 0) { Items.Remove(f.Item.Id); } }