コード例 #1
0
        void OnDelete(Object sender, EventArgs e)
        {
            MenuItem   mi   = sender as MenuItem;//((MenuItem)sender);
            TodoObject item = mi.CommandParameter as TodoObject;

            viewModel.Delete(item);
            viewModel.Read();
        }
コード例 #2
0
        public void AddNewActivity()
        {
            TodoObject item = new TodoObject();

            item.name      = activityName;
            item.date      = new DateTimeOffset(activityDate);
            item.completed = false;
            manager.Create(item);
        }
コード例 #3
0
 public void UpdateTodo(TodoObject item, string name, bool completed, DateTimeOffset date)
 {
     realm.Write(() =>
     {
         item.name      = name;
         item.completed = completed;
         item.date      = date;
     });
 }
コード例 #4
0
        void listview_ItemTapped(Object sender, ItemTappedEventArgs e)
        {
            TodoObject item = e.Item as TodoObject;

            viewModel.ToggleCompleted(item);
        }
コード例 #5
0
 public void ToggleCompleted(TodoObject item)
 {
     manager.UpdateTodo(item, item.name, !item.completed, item.date);
 }