Class TreeViewNode
- Namespace
- Myra.Graphics2D.UI
- Assembly
- Myra.dll
A node in a tree view that can contain content and have child nodes.
public class TreeViewNode : ContentControl, IItemWithId, INotifyAttachedPropertyChanged, IContent, ITreeViewNode
- Inheritance
-
TreeViewNode
- Implements
- Inherited Members
Properties
ChildNodesCount
Gets the number of child nodes under this node.
public int ChildNodesCount { get; }
Property Value
Content
Gets or sets the widget displayed as the node's content.
public override Widget Content { get; set; }
Property Value
ContentHeight
Gets the height of the node's content area in pixels.
public int ContentHeight { get; }
Property Value
IsExpanded
Gets or sets a value indicating whether the node is expanded to show its child nodes.
public bool IsExpanded { get; set; }
Property Value
Mark
Gets the toggle button used to expand or collapse the node.
public ToggleButton Mark { get; }
Property Value
ParentNode
Gets or sets the parent node of this node in the hierarchy.
public TreeViewNode ParentNode { get; }
Property Value
Methods
AddSubNode(Widget)
Adds a new child node to this node with the specified content.
public TreeViewNode AddSubNode(Widget content)
Parameters
contentWidgetThe widget to display as the child node's content.
Returns
- TreeViewNode
The newly created child node.
ApplyStyle(WidgetStyle)
Applies the specified widget style to this tree view node.
protected override void ApplyStyle(WidgetStyle style)
Parameters
styleWidgetStyleThe widget style to apply.
ApplyTreeStyle(TreeStyle)
Applies the specified tree style to this tree view node.
public void ApplyTreeStyle(TreeStyle style)
Parameters
styleTreeStyleThe tree style to apply.
GetSubNode(int)
Gets a child node by its index within this node.
public TreeViewNode GetSubNode(int index)
Parameters
indexintThe zero-based index of the child node.
Returns
- TreeViewNode
The child node at the specified index.
RemoveAllSubNodes()
Removes all child nodes from this node and updates the mark visibility.
public virtual void RemoveAllSubNodes()
RemoveSubNode(TreeViewNode)
Removes a specific child node from this node and clears related state in the tree view.
public void RemoveSubNode(TreeViewNode subNode)
Parameters
subNodeTreeViewNodeThe child node to remove.
RemoveSubNodeAt(int)
Removes the child node at the specified index and clears related state in the tree view.
public void RemoveSubNodeAt(int index)
Parameters
indexintThe zero-based index of the child node to remove.
UpdateMark()
Updates the visibility of the mark (expand/collapse button) based on the number of child nodes.
protected virtual void UpdateMark()