public void AddTodoItem(string title, string description, DateTime date) { TodoListItem newItem = new TodoListItem(title, description, date); this.allItems.Add(newItem); newItem.change_property(); }
public void UpdateTodoItem(string title, string description, DateTime date) { if (this.selectedItem != null) { TodoListItem changeItem = new TodoListItem(title, description, date); int index = allItems.IndexOf(selectedItem); this.allItems.Remove(selectedItem); this.allItems.Insert(index, changeItem); changeItem.change_property(); this.selectedItem = null; } }
public void RemoveTodoItem() { this.allItems.Remove(selectedItem); selectedItem.change_property(); this.selectedItem = null; }