Table of Contents

Class MBList<TItem>

Namespace
Material.Blazor
Assembly
Material.Blazor.dll

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

Func<TItem, object>

HideLineThree

Hides "line three" if True. Defaults to False.

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

Property Value

bool

HideLineTwo

Hides "line two" if True. Defaults to False.

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

Property Value

bool

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

bool

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

MBListStyle?

ListType

The list type.

Overrides ListType

[Parameter]
public MBListType? ListType { get; set; }

Property Value

MBListType?

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

bool

OnClick

An @onclick event handler returning the index of the relevant list item.

[Parameter]
public EventCallback<int> OnClick { get; set; }

Property Value

EventCallback<int>

OnKeyDown

An @onkeydown event handler returning the index of the relevant list item.

[Parameter]
public EventCallback<int> OnKeyDown { get; set; }

Property Value

EventCallback<int>

OnMouseDown

An @onmousedown event handler returning the index of the relevant list item.

[Parameter]
public EventCallback<int> OnMouseDown { get; set; }

Property Value

EventCallback<int>

OnTouchStart

An @ontouchstart event handler returning the index of the relevant list item.

[Parameter]
public EventCallback<int> OnTouchStart { get; set; }

Property Value

EventCallback<int>

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

bool

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

bool

SingleLineDensity

The lists's density if it is a single line list. Ignored if ListType is Dense

[Parameter]
public MBDensity? SingleLineDensity { get; set; }

Property Value

MBDensity?

SuppressIcons

Suppresses icon display if True. Defaults to False.

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

Property Value

bool

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

Task

A Task representing any asynchronous operation.

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()

Returns

Task