Пример #1
0
        public DepartmentViewModel(Department department, DepartmentViewModel parent)
        {
            _department = department;
            _parent = parent;

            _children = new ObservableCollection<DepartmentViewModel>(
                    (from child in _department.Children
                     select new DepartmentViewModel(child, this))
                     .ToList<DepartmentViewModel>());
        }
Пример #2
0
        public DepartmentTreeViewModel(Department rootDepartment)
        {
            _rootDepartment = new DepartmentViewModel(rootDepartment);

            _firstGeneration = new ObservableCollection<DepartmentViewModel>(
                new DepartmentViewModel[] 
                { 
                    _rootDepartment
                });

            //_firstGeneration.CollectionChanged += _firstGeneration_CollectionChanged;

            _searchCommand = new SearchFamilyTreeCommand(this);
        }
Пример #3
0
 public DepartmentViewModel(Department department)
     : this(department, null)
 {
 }