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>()); }
public DepartmentTreeViewModel(Department rootDepartment) { _rootDepartment = new DepartmentViewModel(rootDepartment); _firstGeneration = new ObservableCollection<DepartmentViewModel>( new DepartmentViewModel[] { _rootDepartment }); //_firstGeneration.CollectionChanged += _firstGeneration_CollectionChanged; _searchCommand = new SearchFamilyTreeCommand(this); }
public DepartmentViewModel(Department department) : this(department, null) { }