Class MudTreeViewItem<T>
- Namespace
- MudBlazor
- Assembly
- MudBlazor.dll
public class MudTreeViewItem<T> : MudComponentBase, IComponent, IHandleEvent, IHandleAfterRender, IMudStateHasChanged, IDisposable
Type Parameters
T
- Inheritance
-
MudTreeViewItem<T>
- Implements
- Inherited Members
- Extension Methods
Constructors
MudTreeViewItem()
public MudTreeViewItem()
Properties
BodyContent
Content of the item body, if used replaced the text, end text and end icon rendering.
[Parameter]
[Category("Behavior")]
public RenderFragment<MudTreeViewItem<T?>>? BodyContent { get; set; }
Property Value
CanExpand
If false, TreeViewItem will not be able to expand.
[Parameter]
[Category("Behavior")]
public bool CanExpand { get; set; }
Property Value
Remarks
This is especially useful for lazy-loaded items via ServerData. If you know that an item has no children you can pre-emptively prevent expansion which would only lead to a server request that would not return children anyway.
ChildContent
Child content of component used to create sub levels.
[Parameter]
[Category("Data")]
public RenderFragment? ChildContent { get; set; }
Property Value
Classname
protected string Classname { get; }
Property Value
Content
Content of the item, if used completely replaced the default rendering.
[Parameter]
[Category("Behavior")]
public RenderFragment? Content { get; set; }
Property Value
ContentClassname
protected string ContentClassname { get; }
Property Value
Disabled
If true, TreeViewItem will be disabled.
[Parameter]
[Category("Behavior")]
public bool Disabled { get; set; }
Property Value
EndIcon
Icon placed after the text if set.
[Parameter]
[Category("Behavior")]
public string? EndIcon { get; set; }
Property Value
EndIconColor
The color of the icon. It supports the theme colors.
[Parameter]
[Category("Appearance")]
public Color EndIconColor { get; set; }
Property Value
EndText
The text at the end of the item.
[Parameter]
[Category("Behavior")]
public string? EndText { get; set; }
Property Value
EndTextClass
User class names for the endtext, separated by space.
[Parameter]
[Category("Appearance")]
public string? EndTextClass { get; set; }
Property Value
EndTextTypo
Typography for the endtext.
[Parameter]
[Category("Appearance")]
public Typo EndTextTypo { get; set; }
Property Value
ExpandButtonIcon
The expand/collapse icon.
[Parameter]
[Category("Expanding")]
public string ExpandButtonIcon { get; set; }
Property Value
ExpandButtonIconColor
The color of the expand/collapse button. It supports the theme colors.
[Parameter]
[Category("Expanding")]
public Color ExpandButtonIconColor { get; set; }
Property Value
Expanded
Expand or collapse TreeView item when it has children. Two-way bindable. Note: if you directly set this to true or false (instead of using two-way binding) it will force the item's expansion state.
[Parameter]
[Category("Expanding")]
public bool Expanded { get; set; }
Property Value
ExpandedChanged
Called whenever expanded changed.
[Parameter]
public EventCallback<bool> ExpandedChanged { get; set; }
Property Value
Icon
Icon placed before the text if set.
[Parameter]
[Category("Behavior")]
public string? Icon { get; set; }
Property Value
IconColor
The color of the icon. It supports the theme colors.
[Parameter]
[Category("Appearance")]
public Color IconColor { get; set; }
Property Value
IconExpanded
Alternative icon to show instead of Icon if expanded.
[Parameter]
[Category("Behavior")]
public string? IconExpanded { get; set; }
Property Value
Items
[Parameter]
[Category("Data")]
public IReadOnlyCollection<TreeItemData<T?>>? Items { get; set; }
Property Value
LoadingIcon
The loading icon.
[Parameter]
[Category("Appearance")]
public string LoadingIcon { get; set; }
Property Value
LoadingIconColor
The color of the loading. It supports the theme colors.
[Parameter]
[Category("Appearance")]
public Color LoadingIconColor { get; set; }
Property Value
OnClick
Tree item click event.
[Parameter]
public EventCallback<MouseEventArgs> OnClick { get; set; }
Property Value
OnDoubleClick
Tree item double click event.
[Parameter]
public EventCallback<MouseEventArgs> OnDoubleClick { get; set; }
Property Value
ReadOnly
If true, the MudTreeViewItem's selection can not be changed.
[Parameter]
[Category("Behavior")]
public bool ReadOnly { get; set; }
Property Value
Selected
Set this to true to mark the item initially selected in single selection mode or checked in multi selection mode. You can two-way bind this to get selection updates from this item
[Parameter]
[Category("Selecting")]
public bool Selected { get; set; }
Property Value
SelectedChanged
Called whenever the selected value changed.
[Parameter]
public EventCallback<bool> SelectedChanged { get; set; }
Property Value
Text
The text to display
[Parameter]
[Category("Behavior")]
public string? Text { get; set; }
Property Value
TextClass
User class names for the text, separated by space.
[Parameter]
[Category("Appearance")]
public string? TextClass { get; set; }
Property Value
TextClassname
public string TextClassname { get; }
Property Value
TextTypo
Typography for the text.
[Parameter]
[Category("Appearance")]
public Typo TextTypo { get; set; }
Property Value
Value
Value of the TreeViewItem. Acts as the displayed text if no text is set.
[Parameter]
[Category("Data")]
public T? Value { get; set; }
Property Value
- T
Visible
Indicates whether the tree view item and its children are visible.
[Parameter]
[Category("Appearance")]
public bool Visible { get; set; }
Property Value
Methods
BuildRenderTree(RenderTreeBuilder)
protected override void BuildRenderTree(RenderTreeBuilder __builder)
Parameters
__builder
RenderTreeBuilder
CollapseAllAsync()
Collapse this item and all its children recursively
public Task CollapseAllAsync()
Returns
Dispose()
public void Dispose()
ExpandAllAsync()
Expand this item and all its children recursively
public Task ExpandAllAsync()
Returns
OnInitializedAsync()
protected override Task OnInitializedAsync()
Returns
OnParametersSet()
protected override void OnParametersSet()
ReloadAsync()
Clear the tree items, and try to reload from server.
public Task ReloadAsync()