Skip to main content

TreeView Class

NuGet: GHIElectronics.TinyCLR.UI
Assembly: GHIElectronics.TinyCLR.UI
Namespace: GHIElectronics.TinyCLR.UI.Controls

A hierarchical list of TreeNodes with expand/collapse. Tapping a node's chevron toggles its children; tapping the row selects it.

public class TreeView : Control

Properties​

RowHeight​

public int RowHeight { get; set; }

Row height in pixels.

HeaderColor​

public Color HeaderColor { get; set; }

Colour of node text.

SelectionColor​

public Color SelectionColor { get; set; }

Fill behind the selected row.

Methods​

AddNode(TreeNode node)​

public void AddNode(TreeNode node)

Adds a top-level node.

MeasureOverride(int availableWidth, int availableHeight, out int desiredWidth, out int desiredHeight)​

protected override void MeasureOverride(int availableWidth, int availableHeight, out int desiredWidth, out int desiredHeight)

Reports the full height of all visible rows.

OnTouchUp(TouchEventArgs e)​

protected override void OnTouchUp(TouchEventArgs e)

Toggles a node's expansion (chevron zone) or selects the tapped row.

OnRender(DrawingContext dc)​

public override void OnRender(DrawingContext dc)

Draws each visible node with indentation, a chevron for parents, and the header text.