Class MBList<TItem>
This is a general purpose Material Theme list implementing one and two line MB web component standards. It also implements a Material.Blazor interpretation of the specification for a three line list item.
public class MBList<TItem> : ComponentFoundation, IComponent, IHandleEvent, IHandleAfterRender, IDisposable
Type Parameters
TItem
- Inheritance
-
MBList<TItem>
- Implements
- Inherited Members
Constructors
MBList()
public MBList()
Properties
GetKeysFunc
A function delegate to return the parameters for @key
attributes. If unused
"fake" keys set to GUIDs will be used.
[Parameter]
public Func<TItem, object> GetKeysFunc { get; set; }
Property Value
HideLineThree
Hides "line three" if True. Defaults to False.
[Parameter]
public bool HideLineThree { get; set; }
Property Value
HideLineTwo
Hides "line two" if True. Defaults to False.
[Parameter]
public bool HideLineTwo { get; set; }
Property Value
Icon
The icon render fragment to use if !SuppressIcons
.
Note that you will be expected to render your own icon, and can use MBIcon.
[Parameter]
public RenderFragment<TItem> Icon { get; set; }
Property Value
- RenderFragment<TItem>
Items
The items to display in the list.
[Parameter]
public IEnumerable<TItem> Items { get; set; }
Property Value
- IEnumerable<TItem>
KeyboardInteractions
Allows keyboard interactions if True. Defaults to False.
[Parameter]
public bool KeyboardInteractions { get; set; }
Property Value
LineThree
The "line three" render fragment.
[Parameter]
public RenderFragment<TItem> LineThree { get; set; }
Property Value
- RenderFragment<TItem>
LineTwo
The "line two" render fragment.
[Parameter]
public RenderFragment<TItem> LineTwo { get; set; }
Property Value
- RenderFragment<TItem>
ListStyle
The list style.
Overrides ListStyle
[Parameter]
public MBListStyle? ListStyle { get; set; }
Property Value
ListType
The list type.
Overrides ListType
[Parameter]
public MBListType? ListType { get; set; }
Property Value
MultiLevelElements
Extra elements (must be
div
elements) for a material multilevel list.
[Parameter]
public RenderFragment<TItem> MultiLevelElements { get; set; }
Property Value
- RenderFragment<TItem>
NonInteractive
Sets the non interative Material Theme class if True. Defaults to False.
[Parameter]
public bool NonInteractive { get; set; }
Property Value
OnClick
An @onclick event handler returning the index of the relevant list item.
[Parameter]
public EventCallback<int> OnClick { get; set; }
Property Value
OnKeyDown
An @onkeydown event handler returning the index of the relevant list item.
[Parameter]
public EventCallback<int> OnKeyDown { get; set; }
Property Value
OnMouseDown
An @onmousedown event handler returning the index of the relevant list item.
[Parameter]
public EventCallback<int> OnMouseDown { get; set; }
Property Value
OnTouchStart
An @ontouchstart event handler returning the index of the relevant list item.
[Parameter]
public EventCallback<int> OnTouchStart { get; set; }
Property Value
PrimaryActions
The primary actions render fragment.
[Parameter]
public RenderFragment<TItem> PrimaryActions { get; set; }
Property Value
- RenderFragment<TItem>
Ripple
Applies ripple to the list item if True. Defaults to False.
[Parameter]
public bool Ripple { get; set; }
Property Value
SecondaryActions
The secondary actions render fragment.
[Parameter]
public RenderFragment<TItem> SecondaryActions { get; set; }
Property Value
- RenderFragment<TItem>
ShowSeparators
Shows a MBListDivider between list items if True. Defaults to False.
[Parameter]
public bool ShowSeparators { get; set; }
Property Value
SingleLineDensity
[Parameter]
public MBDensity? SingleLineDensity { get; set; }
Property Value
SuppressIcons
Suppresses icon display if True. Defaults to False.
[Parameter]
public bool SuppressIcons { get; set; }
Property Value
Title
The title line render fragment.
[Parameter]
public RenderFragment<TItem> Title { get; set; }
Property Value
- RenderFragment<TItem>
Methods
BuildRenderTree(RenderTreeBuilder)
Renders the component to the supplied RenderTreeBuilder.
protected override void BuildRenderTree(RenderTreeBuilder __builder)
Parameters
__builder
RenderTreeBuilder
OnInitializedAsync()
Method invoked when the component is ready to start, having received its initial parameters from its parent in the render tree.
Override this method if you will perform an asynchronous operation and want the component to refresh when that operation is completed.
protected override Task OnInitializedAsync()
Returns
OnParametersSetAsync()
When overriding this, call await base.OnParametersSetAsync();
before any user code unless there is a very good reason not to.
protected override Task OnParametersSetAsync()