Class TreeNode<T>
Provides the hierarchy state shared by nodes used with TreeModel<T>.
public abstract class TreeNode<T> where T : TreeNode<T>
Type Parameters
TThe concrete node type.
- Inheritance
-
TreeNode<T>
- Inherited Members
Remarks
Derive application node types from this class to avoid repeating parent and child storage. Use Add(T) only while constructing a detached tree. Once a node is in a TreeModel<T>, use that model's mutation methods so connected views receive the required structural change notifications.
Properties
Children
Gets the child nodes.
public IReadOnlyList<T> Children { get; }
Property Value
Parent
Gets the parent node, or null for a root node.
public T Parent { get; }
Property Value
- T
Methods
Add(T)
Appends child while constructing a detached tree.
public T Add(T child)
Parameters
childT
Returns
- T
This node, so calls can be chained.