public TreeListBoxItem() { Children = new ObservableCollection<TreeListBoxItem>(); Children.CollectionChanged += Children_CollectionChanged; ChildrenProxy = new CompositeListProxy<TreeListBoxItem>(Children, e => e.List); List = new CompositeList(); List.AddCollection(new TreeListBoxItem[] { this }); List.AddCollection(ChildrenProxy); IsVisible = true; IsSelected = false; }
public TreeListBoxItem(bool isExanded) { _IsExpanded = isExanded; Children = new ObservableCollection<TreeListBoxItem>(); ChildrenProxy = new CompositeListProxy<TreeListBoxItem>(Children, e => e.List); List = new CompositeList(); List.AddCollection(new TreeListBoxItem[] { this }); if (isExanded) { List.AddCollection(ChildrenProxy); } IsVisible = true; IsSelected = false; }