public void AddTask()
        { 
            var task = new Task(NewTaskDescription, SelectedUser);

            NewTaskDescription = "";

            _tasks.Add(task);
            TasksView.Refresh();
        }
        public TaskListViewModel()
        {
            Users = new List<User>() { SelectedUser };
            _tasks = new List<Task>();

            var u1 = new User { Id = 1,Name = "Ivan" };
            var u2 = new User { Id = 2, Name = "Ines" };

            Users.Add(u1);
            Users.Add(u2);

            var t1 = new Task("Clean kitchen", u1);
            var t2 = new Task("Wash dishes", u1);
            var t3 = new Task("Watch tv", u2);

            _tasks.Add(t1);
            _tasks.Add(t2);
            _tasks.Add(t3);

            TasksView = CollectionViewSource.GetDefaultView(_tasks);
            TasksView.Filter = FilterTasks; // Attach the FilterTasks method to the TasksView.Filter
        }
 public void FinishTask(Task task)
 {
     task.Finish();
 }