Table of Contents

Class BOBTreeSelector<TItem>

Namespace
BlazOrbit.Components
Assembly
BlazOrbit.dll
[GenerateComponentInfo]
public class BOBTreeSelector<TItem> : BOBComponentBase, IPureBuiltComponent, IBuiltComponent, IHasSize

Type Parameters

TItem
Inheritance
object
ComponentBase
BOBTreeSelector<TItem>
Implements
Inherited Members

Constructors

BOBTreeSelector()

public BOBTreeSelector()

Properties

AnimateExpand

AnimateExpand.

[Parameter]
public bool AnimateExpand { get; set; }

Property Value

bool

Cache

Cache.

[Parameter]
public TreeNodeCache<TItem>? Cache { get; set; }

Property Value

TreeNodeCache<TItem>

ChildContent

Content rendered inside the component.

[Parameter]
public RenderFragment? ChildContent { get; set; }

Property Value

RenderFragment

ChildrenSelector

Returns the children of an item. Use this for in-memory hierarchical data; pair with HasChildrenSelector for lazy trees.

[Parameter]
public Func<TItem, IEnumerable<TItem>?>? ChildrenSelector { get; set; }

Property Value

Func<TItem, IEnumerable<TItem>>

CollapseIcon

Material icon name for the Collapse.

[Parameter]
public IconKey CollapseIcon { get; set; }

Property Value

IconKey

DisplayTextSelector

Returns the visible text for an item. Defaults to item.ToString().

[Parameter]
public Func<TItem, string>? DisplayTextSelector { get; set; }

Property Value

Func<TItem, string>

ExpandAll

ExpandAll.

[Parameter]
public bool ExpandAll { get; set; }

Property Value

bool

ExpandIcon

Material icon name for the Expand.

[Parameter]
public IconKey ExpandIcon { get; set; }

Property Value

IconKey

ExpandedKeys

ExpandedKeys.

[Parameter]
public HashSet<string>? ExpandedKeys { get; set; }

Property Value

HashSet<string>

ExpandedKeysChanged

ExpandedKeysChanged.

[Parameter]
public EventCallback<HashSet<string>> ExpandedKeysChanged { get; set; }

Property Value

EventCallback<HashSet<string>>

HasChildrenSelector

Returns whether an item has children without loading them. Enables lazy expansion via OnLoadChildren.

[Parameter]
public Func<TItem, bool>? HasChildrenSelector { get; set; }

Property Value

Func<TItem, bool>

Items

Root items the tree renders. May be null when items are registered via ChildContent instead.

[Parameter]
public IEnumerable<TItem>? Items { get; set; }

Property Value

IEnumerable<TItem>

KeySelector

Returns a stable key for an item. Required for keyboard navigation and lazy loading.

[Parameter]
public Func<TItem, string>? KeySelector { get; set; }

Property Value

Func<TItem, string>

NodeTemplate

Custom template for rendering the Node.

[Parameter]
public RenderFragment<TreeSelectionNode<TItem>>? NodeTemplate { get; set; }

Property Value

RenderFragment<TreeSelectionNode<TItem>>

OnLoadChildren

Called the first time a node is expanded with no in-memory children. Result is cached on the tree.

[Parameter]
public Func<TItem, Task<IEnumerable<TItem>>>? OnLoadChildren { get; set; }

Property Value

Func<TItem, Task<IEnumerable<TItem>>>

OnNodeClick

Raised when the NodeClick event occurs.

[Parameter]
public EventCallback<TreeNodeEventArgs<TreeSelectionNode<TItem>>> OnNodeClick { get; set; }

Property Value

EventCallback<TreeNodeEventArgs<TreeSelectionNode<TItem>>>

OnNodeCollapse

Raised when the NodeCollapse event occurs.

[Parameter]
public EventCallback<TreeNodeEventArgs<TreeSelectionNode<TItem>>> OnNodeCollapse { get; set; }

Property Value

EventCallback<TreeNodeEventArgs<TreeSelectionNode<TItem>>>

OnNodeExpand

Raised when the NodeExpand event occurs.

[Parameter]
public EventCallback<TreeNodeEventArgs<TreeSelectionNode<TItem>>> OnNodeExpand { get; set; }

Property Value

EventCallback<TreeNodeEventArgs<TreeSelectionNode<TItem>>>

SelectedKeys

SelectedKeys.

[Parameter]
public HashSet<string>? SelectedKeys { get; set; }

Property Value

HashSet<string>

SelectedKeysChanged

SelectedKeysChanged.

[Parameter]
public EventCallback<HashSet<string>> SelectedKeysChanged { get; set; }

Property Value

EventCallback<HashSet<string>>

SelectionMode

SelectionMode.

[Parameter]
public TreeSelectionMode SelectionMode { get; set; }

Property Value

TreeSelectionMode

ShowCheckboxes

When true, the Checkboxes is shown.

[Parameter]
public bool ShowCheckboxes { get; set; }

Property Value

bool

Size

Visual size of the component.

[Parameter]
public BOBSize Size { get; set; }

Property Value

BOBSize

Methods

BuildComponentCssVariables(Dictionary<string, string>)

Contributes additional CSS custom properties to the inline style attribute. Keys that collide with framework-owned --bob-inline-* variables will be overwritten.

public void BuildComponentCssVariables(Dictionary<string, string> cssVariables)

Parameters

cssVariables Dictionary<string, string>

BuildComponentDataAttributes(Dictionary<string, object>)

Contributes additional data- attributes to the root element. Keys that collide with framework-owned data-bob- attributes will be overwritten.

public void BuildComponentDataAttributes(Dictionary<string, object> dataAttributes)

Parameters

dataAttributes Dictionary<string, object>

BuildRenderTree(RenderTreeBuilder)

Renders the component to the supplied Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder.

protected override void BuildRenderTree(RenderTreeBuilder __builder)

Parameters

__builder RenderTreeBuilder

ClearSelection()

public void ClearSelection()

CollapseAllNodes()

public void CollapseAllNodes()

Dispose()

public void Dispose()

ExpandAllNodes()

public void ExpandAllNodes()

GetNode(string)

public TreeSelectionNode<TItem>? GetNode(string key)

Parameters

key string

Returns

TreeSelectionNode<TItem>

GetSelectedNodes()

public IReadOnlyCollection<TreeSelectionNode<TItem>> GetSelectedNodes()

Returns

IReadOnlyCollection<TreeSelectionNode<TItem>>

InvalidateCache(string?)

public void InvalidateCache(string? key = null)

Parameters

key string

IsSelected(string)

public bool IsSelected(string key)

Parameters

key string

Returns

bool

OnAfterRender(bool)

Method invoked after each time the component has rendered interactively and the UI has finished updating (for example, after elements have been added to the browser DOM). Any Microsoft.AspNetCore.Components.ElementReference fields will be populated by the time this runs.

This method is not invoked during prerendering or server-side rendering, because those processes are not attached to any live browser DOM and are already complete before the DOM is updated.

protected override void OnAfterRender(bool firstRender)

Parameters

firstRender bool

Set to true if this is the first time Microsoft.AspNetCore.Components.ComponentBase.OnAfterRender(bool) has been invoked on this component instance; otherwise false.

Remarks

The Microsoft.AspNetCore.Components.ComponentBase.OnAfterRender(bool) and Microsoft.AspNetCore.Components.ComponentBase.OnAfterRenderAsync(bool) lifecycle methods are useful for performing interop, or interacting with values received from @ref. Use the firstRender parameter to ensure that initialization work is only performed once.

OnInitialized()

Method invoked when the component is ready to start, having received its initial parameters from its parent in the render tree.

protected override void OnInitialized()

OnParametersSet()

Method invoked when the component has received parameters from its parent in the render tree, and the incoming values have been assigned to properties.

protected override void OnParametersSet()

SelectAll()

public void SelectAll()