private void MoveTask(Tasklib.Task task, StackPanel target) { string topicname = (Topic.None.Equals(task.Topic) ? this.NoneTopicName : task.Topic); TopicView2?completedTopicView = GetTopicView(target.Children, topicname); completedTopicView.AddTask(task); }
private void TopicView_TaskStatusChanged(TopicView2 topicView, Tasklib.Task task, bool newStatus) { if (newStatus != task.Done) { // Remove the Task from the TopicView2 it was in topicView.RemoveTask(task); if (newStatus) // status is done, was open { task.SetDone(); MoveTask(task, stkpnlCompletedTasks); if (topicView.Tasks == 0) { stkpnlOpenTasks.Children.Remove(topicView); } } else { task.SetUndone(); MoveTask(task, stkpnlOpenTasks); if (topicView.Tasks == 0) { stkpnlCompletedTasks.Children.Remove(topicView); } } this.Save(); } topicView.OrderTasks(); }