Class TwTreeList
- Namespace
- TwBlazor.Components
- Assembly
- TwBlazor.dll
Root of a tree of expandable/selectable items: renders the outer <ul role="tree"> and
hosts nested TwTreeListItem nodes, given as ChildContent - typically
generated with your own @foreach over whatever data you already have.
public class TwTreeList : TwBlazorComponentBase, IComponent, IHandleEvent, IHandleAfterRender, ITwComponent
- Inheritance
-
TwTreeList
- Implements
- Inherited Members
Remarks
Every TwTreeListItem in the tree - regardless of nesting depth - cascades a reference to this root instance, so a checkbox toggle anywhere can call back into TwBlazor.Components.TwTreeList.NotifyDescendantChangedAsync to re-render the whole tree (needed for ancestors to reflect an indeterminate state once their descendants disagree).
Constructors
TwTreeList()
public TwTreeList()
Properties
ChildContent
Gets or sets the root-level TwTreeListItem nodes.
[Parameter]
public RenderFragment? ChildContent { get; set; }
Property Value
HideIcons
Gets or sets whether each node's leading icon is hidden. Icons are shown by default - a folder
for a node with children, a generic file icon for a leaf - unless a node's own Icon
overrides it.
[Parameter]
public bool HideIcons { get; set; }
Property Value
ShowCheckboxes
Gets or sets whether a checkbox is rendered next to each node. Checking or unchecking a node cascades to all of its descendants; a parent whose descendants disagree renders indeterminate.
[Parameter]
public bool ShowCheckboxes { get; set; }
Property Value
Methods
BuildRenderTree(RenderTreeBuilder)
Renders the component to the supplied RenderTreeBuilder.
protected override void BuildRenderTree(RenderTreeBuilder __builder)
Parameters
__builderRenderTreeBuilder