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.

Fields
flag
propertyChangedHandler
Properties
AllowDrag
DebugTreeName
Entity
Id
IsExpanded
IsRoot
Name
Methods
GetEnumerator()
ToString()
Events
CollectionChanged
PropertyChanged
Explicit Interface Implementations
System.Collections.Generic.ICollection<Friflo.Engine.ECS.Collections.ExplorerItem>.Add(ExplorerItem)
System.Collections.Generic.ICollection<Friflo.Engine.ECS.Collections.ExplorerItem>.Clear()
System.Collections.Generic.ICollection<Friflo.Engine.ECS.Collections.ExplorerItem>.Contains(ExplorerItem)
System.Collections.Generic.ICollection<Friflo.Engine.ECS.Collections.ExplorerItem>.CopyTo(ExplorerItem[], int)
System.Collections.Generic.ICollection<Friflo.Engine.ECS.Collections.ExplorerItem>.Count
System.Collections.Generic.ICollection<Friflo.Engine.ECS.Collections.ExplorerItem>.IsReadOnly
System.Collections.Generic.ICollection<Friflo.Engine.ECS.Collections.ExplorerItem>.Remove(ExplorerItem)
System.Collections.Generic.IList<Friflo.Engine.ECS.Collections.ExplorerItem>.IndexOf(ExplorerItem)
System.Collections.Generic.IList<Friflo.Engine.ECS.Collections.ExplorerItem>.Insert(int, ExplorerItem)
System.Collections.Generic.IList<Friflo.Engine.ECS.Collections.ExplorerItem>.RemoveAt(int)
System.Collections.Generic.IReadOnlyCollection<Friflo.Engine.ECS.Collections.ExplorerItem>.Count
System.Collections.ICollection.CopyTo(Array, int)
System.Collections.ICollection.Count
System.Collections.ICollection.IsSynchronized
System.Collections.ICollection.SyncRoot
System.Collections.IEnumerable.GetEnumerator()
System.Collections.IList.Add(object)
System.Collections.IList.Clear()
System.Collections.IList.Contains(object)
System.Collections.IList.IndexOf(object)
System.Collections.IList.Insert(int, object)
System.Collections.IList.IsFixedSize
System.Collections.IList.IsReadOnly
System.Collections.IList.Remove(object)
System.Collections.IList.RemoveAt(int)
this[int]
this[int]
this[int]