Table of Contents

Class TreeNode<T>

Namespace
Qt.Bridge.Models
Assembly
Qt.Bridge.CSharp.Api.dll

Provides the hierarchy state shared by nodes used with TreeModel<T>.

public abstract class TreeNode<T> where T : TreeNode<T>

Type Parameters

T

The 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

IReadOnlyList<T>

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

child T

Returns

T

This node, so calls can be chained.