public void DeleteTask(Chores chore) { var oldTask = chores.Find(t => t.Id == chore.Id); chores.Remove(oldTask); NavigationController.PopViewController(true); }
public void CreateTask() { // first, add the task to the underlying data var newId = chores[chores.Count - 1].Id + 1; var newChore = new Chores { Id = newId }; chores.Add(newChore); // then open the detail view to edit it var detail = Storyboard.InstantiateViewController("detail") as TaskDetailViewController; detail.SetTask(this, newChore); NavigationController.PushViewController(detail, true); }
// this will be called before the view is displayed public void SetTask(ItemViewController d, Chores task) { Delegate = d; currentTask = task; }
public void SaveTask(Chores chore) { var oldTask = chores.Find(t => t.Id == chore.Id); NavigationController.PopViewController(true); }