async Task DeleteList(ReminderList list) { ReminderLists.Remove(list); await ReminderListDataStore.DeleteModelAsync(list); //todo: delete all reminders on this list }
async Task ExecuteLoadReminderListsCommand() { if (IsBusy) { return; } IsBusy = true; try { ReminderLists.Clear(); var lists = await ReminderListDataStore.GetModelsAsync(true); foreach (var list in lists) { var reminders = await ReminderDataStore.GetModelsAsync(false, new Dictionary <Constants.Parameter, object>() { { Constants.Parameter.ReminderListId, list.Id } }); list.DetailString = string.Format("{0} todo of {1}", reminders.Where(r => r.Completed == false).ToList().Count(), reminders.Count()); ReminderLists.Add(list); } } catch (Exception ex) { Debug.WriteLine(ex); } finally { IsBusy = false; } }
async Task UpdateReminder(ReminderList list) { await ReminderListDataStore.UpdateModelAsync(list); await ExecuteLoadReminderListsCommand(); }
async Task AddList(ReminderList list) { ReminderLists.Insert(0, list); await ReminderListDataStore.AddModelAsync(list); }