예제 #1
0
        private void LoadTasks(IEnumerable <Task> tasks)
        {
            foreach (var task in tasks)
            {
                task.Project = Project;

                var taskViewModel = new TreeTaskViewModel(this, task, _dataService);
                taskViewModel.IsLoadOnDemandEnabled = false;
                //LoadSubTasks(task, taskViewModel);
                Children.Add(taskViewModel);
            }
        }
예제 #2
0
        //private void LoadSubTasks(Task task, TreeViewItemViewModel viewModel)
        //{
        //    foreach (var subtask in task.SubTasks)
        //    {
        //        subtask.Project = Project;
        //        var taskViewModel = new TreeTaskViewModel(viewModel, subtask, _dataService);
        //        taskViewModel.IsLoadOnDemandEnabled = false;
        //        viewModel.Children.Add(taskViewModel);
        //        LoadSubTasks(subtask, viewModel);
        //    }
        //}

        protected override void LoadChildren()
        {
            foreach (var task in Project.Tasks)
            {
                task.Project = Project;

                var taskViewModel = new TreeTaskViewModel(this, task, _dataService)
                {
                    IsLoadOnDemandEnabled = false
                };
                //LoadSubTasks(task, taskViewModel);
                Children.Add(taskViewModel);
            }
            //_dataService.GetTasksByProjectCompleted += _dataService_GetTasksByProjectCompleted;
            //_dataService.GetTasksByProject(Project, true, true);
        }