Class BOBTreeMenu<TItem>
- Namespace
- BlazOrbit.Components
- Assembly
- BlazOrbit.dll
[GenerateComponentInfo]
public class BOBTreeMenu<TItem> : BOBComponentBase, IPureBuiltComponent, IBuiltComponent, IHasSize
Type Parameters
TItem
- Inheritance
-
objectComponentBaseBOBTreeMenu<TItem>
- Implements
- Inherited Members
Constructors
BOBTreeMenu()
public BOBTreeMenu()
Properties
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.
[Parameter]
public Func<TItem, IEnumerable<TItem>?>? ChildrenSelector { get; set; }
Property Value
- Func<TItem, IEnumerable<TItem>>
Collapsible
Collapsible.
[Parameter]
public bool Collapsible { get; set; }
Property Value
- bool
ExpandAll
ExpandAll.
[Parameter]
public bool ExpandAll { get; set; }
Property Value
- bool
ExpandMode
ExpandMode.
[Parameter]
public TreeMenuExpandMode ExpandMode { get; set; }
Property Value
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>
HoverCloseDelay
HoverCloseDelay.
[Parameter]
public int HoverCloseDelay { get; set; }
Property Value
- int
HoverOpenDelay
HoverOpenDelay.
[Parameter]
public int HoverOpenDelay { get; set; }
Property Value
- int
Items
Root items the menu renders.
[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>
Match
Overrides the default NavLinkMatch for all the child menu items.
[Parameter]
public NavLinkMatch? Match { get; set; }
Property Value
- NavLinkMatch?
NodeTemplate
Custom template for rendering the Node.
[Parameter]
public RenderFragment<TreeMenuNode<TItem>>? NodeTemplate { get; set; }
Property Value
- RenderFragment<TreeMenuNode<TItem>>
OnLoadChildren
Called the first time a node is expanded with no in-memory children. Result is cached on the menu.
[Parameter]
public Func<TItem, Task<IEnumerable<TItem>>>? OnLoadChildren { get; set; }
Property Value
- Func<TItem, Task<IEnumerable<TItem>>>
OnNavigate
Raised when the Navigate event occurs.
[Parameter]
public EventCallback<string> OnNavigate { get; set; }
Property Value
- EventCallback<string>
OnNodeClick
Raised when the NodeClick event occurs.
[Parameter]
public EventCallback<TreeNodeEventArgs<TreeMenuNode<TItem>>> OnNodeClick { get; set; }
Property Value
- EventCallback<TreeNodeEventArgs<TreeMenuNode<TItem>>>
Orientation
Orientation.
[Parameter]
public TreeMenuOrientation Orientation { get; set; }
Property Value
Size
Visual size of the component.
[Parameter]
public BOBSize Size { get; set; }
Property Value
Trigger
Trigger.
[Parameter]
public TreeMenuTrigger Trigger { get; set; }
Property Value
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
cssVariablesDictionary<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
dataAttributesDictionary<string, object>
BuildRenderTree(RenderTreeBuilder)
Renders the component to the supplied Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder.
protected override void BuildRenderTree(RenderTreeBuilder __builder)
Parameters
__builderRenderTreeBuilder
CollapseAllNodes()
public void CollapseAllNodes()
Dispose()
public void Dispose()
ExpandAllNodes()
public void ExpandAllNodes()
GetNode(string)
public TreeMenuNode<TItem>? GetNode(string key)
Parameters
keystring
Returns
- TreeMenuNode<TItem>
InvalidateCache(string?)
public void InvalidateCache(string? key = null)
Parameters
keystring
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
firstRenderboolSet to
trueif this is the first time Microsoft.AspNetCore.Components.ComponentBase.OnAfterRender(bool) has been invoked on this component instance; otherwisefalse.
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()