示例#1
0
        async Task DeleteList(ReminderList list)
        {
            ReminderLists.Remove(list);
            await ReminderListDataStore.DeleteModelAsync(list);

            //todo: delete all reminders on this list
        }
示例#2
0
        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;
            }
        }
示例#3
0
 async Task AddList(ReminderList list)
 {
     ReminderLists.Insert(0, list);
     await ReminderListDataStore.AddModelAsync(list);
 }