Table of Contents

Class MBButton

Namespace
Material.Blazor
Assembly
Material.Blazor.dll

This is a general purpose Material Theme button, with provision for standard MB styling, leading and trailing icons and all standard Blazor events. Adds the "mdc-card__action--button" class when placed inside an MBCard.

public class MBButton : ComponentFoundation, IComponent, IHandleEvent, IHandleAfterRender, IDisposable
Inheritance
MBButton
Implements
Inherited Members

Constructors

MBButton()

public MBButton()

Properties

BadgeExited

When true collapses the badge.

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

Property Value

bool

BadgeStyle

The badge's style - see MBBadgeStyle, defaults to ValueBearing.

[Parameter]
public MBBadgeStyle BadgeStyle { get; set; }

Property Value

MBBadgeStyle

BadgeValue

The button's density.

[Parameter]
public string BadgeValue { get; set; }

Property Value

string

ButtonStyle

The button's Material Theme style - see MBButtonStyle.

Overrides ButtonStyle, CardActionButtonStyle or DialogActionButtonStyle as relevant.

[Parameter]
public MBButtonStyle? ButtonStyle { get; set; }

Property Value

MBButtonStyle?

Density

The button's density.

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

Property Value

MBDensity?

DialogAction

A string value to return from an MBDialog when this button is pressed.

[Parameter]
public string DialogAction { get; set; }

Property Value

string

HasBadge

Determines whether the button has a badge - defaults to false.

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

Property Value

bool

IconFoundry

The foundry to use for both leading and trailing icons.

IconFoundry="IconHelper.MIIcon()"

IconFoundry="IconHelper.FAIcon()"

IconFoundry="IconHelper.OIIcon()"

Overrides IconFoundryName

[Parameter]
public IMBIconFoundry? IconFoundry { get; set; }

Property Value

IMBIconFoundry

Label

The button's label.

[Parameter]
public string Label { get; set; }

Property Value

string

LeadingIcon

The leading icon's name. No leading icon shown if not set.

[Parameter]
public string? LeadingIcon { get; set; }

Property Value

string

TouchTarget

Inclusion of touch target

[Parameter]
public bool? TouchTarget { get; set; }

Property Value

bool?

TrailingIcon

The trailing icon's name. No leading icon shown if not set.

[Parameter]
public string? TrailingIcon { get; set; }

Property Value

string

Methods

BuildRenderTree(RenderTreeBuilder)

Renders the component to the supplied RenderTreeBuilder.

protected override void BuildRenderTree(RenderTreeBuilder __builder)

Parameters

__builder RenderTreeBuilder

GetButtonReference()

Returns an ElementReference for the control's button reference element.

public ElementReference GetButtonReference()

Returns

ElementReference

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.