//List Controller public void Add(TaskTodo task) { TaskTodo.Add(task); if (!History.Contains(task)) { History.Add(task); } }
public EditWindow(MainWindow init) { InitializeComponent(); initial = init; elemGen = initial.SelectedTask; MainPanel.DataContext = elemGen; Dateinfo.SelectedDate = elemGen.DueTo; }
private void Edit_Task_Click(object sender, RoutedEventArgs e) { if (new EditWindow(this).ShowDialog() == false) { UpdateListView(); Edit_Task.IsEnabled = false; SelectedTask = null; } }
private void AddTask_Click(object sender, RoutedEventArgs e) { ToDoListConstructWindow elem = new ToDoListConstructWindow(this); var task = new TaskTodo(); if (elem.ShowDialog() == true) { } }
private void Delete_Task_Click(object sender, RoutedEventArgs e) { if (SelectedTask != null) { GeneralListFromDataBase.Remove(SelectedTask); SelectedTask = null; UpdateListView(); Delete_Task.IsEnabled = false; Edit_Task.IsEnabled = false; } }
private void elem_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (SelectedTask == null) { var temp = sender as ListView; SelectedTask = temp.SelectedItem as TaskTodo; Edit_Task.IsEnabled = true; Delete_Task.IsEnabled = true; } else { var temp = sender as ListView; SelectedTask = temp.SelectedItem as TaskTodo; } }
public void ChangeDateDue(TaskTodo task, DateTime new_Due_Date) { task.DueTo = new_Due_Date; }
public void Remove(TaskTodo task) { TaskTodo.Remove(task); }
public void Remove(TaskTodo task) { ListOfTask.Remove(task); }
//adding, removing and cleaning block public void Add(TaskTodo task) { ListOfTask.Add(task); }