Пример #1
0
        private ListTaskViewModel GetTaskViewModel(Task task, ListItemModelBase parent)
        {
            var taskViewModel = new ListTaskViewModel(task, parent, _dataService, _userRepository);

            foreach (var timeEntry in task.TimeEntries)
            {
                var timeEntryViewModel = GetTimeEntryViewModel(timeEntry, taskViewModel);
                if (timeEntryViewModel != null)
                {
                    taskViewModel.Children.Add(timeEntryViewModel);
                }
            }

            return(taskViewModel);
        }
Пример #2
0
        private ListProjectViewModel GetProjectViewModel(Project project, ListItemModelBase parent)
        {
            var projectViewModel = new ListProjectViewModel(project, parent, _dataService, _userRepository);

            foreach (var task in project.Tasks)
            {
                var taskViewModel = GetTaskViewModel(task, projectViewModel);
                if (taskViewModel != null)
                {
                    projectViewModel.Children.Add(taskViewModel);
                }
            }

            return(projectViewModel);
        }
Пример #3
0
        private void ApplyActionPanel(ListItemModelBase obj)
        {
            if (obj == null)
            {
                RemoveActionPanels();
                return;
            }

            _canExportToExcel = true;
            ExportToExcel.RaiseCanExecuteChanged();


            var actionPanelViewFactory = obj.ActionPanelViewFactory;

            if (actionPanelViewFactory != null)
            {
                RemoveActionPanels();
                ActionPanels.Add(actionPanelViewFactory.CreateActionPanelView());
                //OnPropertyChanged("ActionPanels");
            }
        }