ExplorerItem.md
February 25, 2024 · View on GitHub
Friflo.Engine.ECS
Friflo.Engine.ECS.Collections
ExplorerItem Class
Implements same interfaces as System.Collections.ObjectModel.ObservableCollection<> to act as a replacement
for this container class using the generic type ExplorerItem.
This enables displaying and mutation of Entity's in a
Avalonia.Controls.TreeDataGrid.
A specialized implementation of this control is the ExplorerTreeDataGrid in this repository.
public sealed class ExplorerItem :
System.Collections.Generic.IList<Friflo.Engine.ECS.Collections.ExplorerItem>,
System.Collections.Generic.ICollection<Friflo.Engine.ECS.Collections.ExplorerItem>,
System.Collections.Generic.IEnumerable<Friflo.Engine.ECS.Collections.ExplorerItem>,
System.Collections.IEnumerable,
System.Collections.IList,
System.Collections.ICollection,
System.Collections.Generic.IReadOnlyList<Friflo.Engine.ECS.Collections.ExplorerItem>,
System.Collections.Generic.IReadOnlyCollection<Friflo.Engine.ECS.Collections.ExplorerItem>,
System.Collections.Specialized.INotifyCollectionChanged,
System.ComponentModel.INotifyPropertyChanged
Inheritance System.Object 🡒 ExplorerItem
Implements System.Collections.Generic.IList<ExplorerItem>, System.Collections.Generic.ICollection<ExplorerItem>, System.Collections.Generic.IEnumerable<ExplorerItem>, System.Collections.IEnumerable, System.Collections.IList, System.Collections.ICollection, System.Collections.Generic.IReadOnlyList<ExplorerItem>, System.Collections.Generic.IReadOnlyCollection<ExplorerItem>, System.Collections.Specialized.INotifyCollectionChanged, System.ComponentModel.INotifyPropertyChanged
Remarks
It seems a common and reasonable approach that other UI frameworks like MAUI or UNO Platform provide
TreeView controls by using TreeView items implementing System.Collections.Specialized.INotifyCollectionChanged and
optionally System.ComponentModel.INotifyPropertyChanged.
Major advantages of this approach.
- Support millions of items within a TreeView hierarchy without any UI stuttering.
- Enabling binding hierarchical data to a UI without the need of 3rd party libraries in the data layer.
System.Collections.Specialized.INotifyCollectionChanged and optionally System.ComponentModel.INotifyPropertyChanged of the BCL are sufficient.
| Fields | |
|---|---|
| flag | |
| propertyChangedHandler |
| Properties | |
|---|---|
| AllowDrag | |
| DebugTreeName | |
| Entity | |
| Id | |
| IsExpanded | |
| IsRoot | |
| Name |
| Methods | |
|---|---|
| GetEnumerator() | |
| ToString() |
| Events | |
|---|---|
| CollectionChanged | |
| PropertyChanged |