This class wraps a hierarchical collection with observable collection, containing the flattened items, wrapped in HierarchicalItem. This collection doesn't track the source collection for changes.
Definition
Namespace:Telerik.Windows.Core
Assembly:Telerik.Windows.Scheduling.Core.dll
Syntax:
public class HierarchicalCollectionAdapter : PropertyChangedBase, IList<HierarchicalItem>, ICollection<HierarchicalItem>, IEnumerable<HierarchicalItem>, IEnumerable, IDisposable, IHierarchicalCollectionAdapter<HierarchicalItem>, INotifyCollectionChanged, INotifyPropertyChanged, IEditableHierarchical
Inheritance: objectPropertyChangedBaseHierarchicalCollectionAdapter
Derived Classes:
Implements:
Inherited Members
Constructors
Initializes a new instance of the HierarchicalCollectionAdapter class. It doesn't track the source hierarchical collection for changes.
public HierarchicalCollectionAdapter(IEnumerable hierarchicalItems, Func<HierarchicalItem, bool> shouldExpandedByDefault)
The hierarchical collection to be flattened.
shouldExpandedByDefaultFunc<HierarchicalItem, bool>Properties
Methods
protected ~HierarchicalCollectionAdapter()
protected virtual HierarchicalItem CreateWrapper(HierarchicalItem parent, object item, int sourceIndex)
public void Dispose()
Implements:
When overridden in the inherited class, this method returns all the children of the provided item.
protected virtual IEnumerable GetChildren(object item)
The item, which children are to be retrieved.
Returns:All the children of the provided item.
public HierarchicalItem GetItemWrapperByItemKey(object key)
Implements:
When overridden in the inherited class, this method is used to perform additional initializations to the newly created wrapper. It is the best place to initialize the IsExpanded and CanExpand properties. This method is called when a new wrapper is initialized. In the base method only the SourceItem is set and an event handler is hooked to the PropertyChanged event to track changes in the IsExpanded property.
protected virtual void InitializeWrapper(HierarchicalItem wrapper, object item)
The wrapper that was created for the item.
itemobjectThe item that have been wrapped.
protected virtual void OnCollectionChanged(NotifyCollectionChangedEventArgs e)
protected virtual void OnItemPropertyChanged(ItemPropertyChangedEventArgs<HierarchicalItem> e)
protected bool ShouldExpandByDefault(HierarchicalItem item)
Events
Occurs when the collection changes.
public event NotifyCollectionChangedEventHandler CollectionChanged
Implements:
public event EventHandler<ItemPropertyChangedEventArgs<HierarchicalItem>> ItemPropertyChanged