void OnDelete(Object sender, EventArgs e) { MenuItem mi = sender as MenuItem;//((MenuItem)sender); TodoObject item = mi.CommandParameter as TodoObject; viewModel.Delete(item); viewModel.Read(); }
public void AddNewActivity() { TodoObject item = new TodoObject(); item.name = activityName; item.date = new DateTimeOffset(activityDate); item.completed = false; manager.Create(item); }
public void UpdateTodo(TodoObject item, string name, bool completed, DateTimeOffset date) { realm.Write(() => { item.name = name; item.completed = completed; item.date = date; }); }
void listview_ItemTapped(Object sender, ItemTappedEventArgs e) { TodoObject item = e.Item as TodoObject; viewModel.ToggleCompleted(item); }
public void ToggleCompleted(TodoObject item) { manager.UpdateTodo(item, item.name, !item.completed, item.date); }