Table of Contents

Class MudElement

Namespace
MudBlazor
Assembly
MudBlazor.dll

A primitive component which allows dynamically changing the HTML element rendered under the hood.

public class MudElement : MudComponentBase, IComponent, IHandleEvent, IHandleAfterRender, IMudStateHasChanged
Inheritance
MudElement
Implements
Inherited Members
Extension Methods

Constructors

MudElement()

public MudElement()

Properties

ChildContent

The content within this element.

[Parameter]
[Category("Misc")]
public RenderFragment? ChildContent { get; set; }

Property Value

RenderFragment

ClickPropagation

Propagates click events beyond this element.

[Parameter]
[Category("Behavior")]
public bool ClickPropagation { get; set; }

Property Value

bool

Remarks

Defaults to true.

HtmlTag

The HTML tag rendered for this element.

[Parameter]
[Category("Misc")]
public string HtmlTag { get; set; }

Property Value

string

Remarks

Defaults to span.

PreventDefault

Prevents the default action when this element is clicked.

[Parameter]
[Category("Behavior")]
public bool PreventDefault { get; set; }

Property Value

bool

Remarks

Defaults to false, allowing default actions.

Ref

The ElementReference to bind to.

[Parameter]
[Category("Misc")]
public ElementReference? Ref { get; set; }

Property Value

ElementReference?

Remarks

This is typically bound via @bind-Ref="myRef". When this property changes, the RefChanged event occurs.

RefChanged

Occurs when Ref has changed.

[Parameter]
public EventCallback<ElementReference> RefChanged { get; set; }

Property Value

EventCallback<ElementReference>

Methods

BuildRenderTree(RenderTreeBuilder)

protected override void BuildRenderTree(RenderTreeBuilder builder)

Parameters

builder RenderTreeBuilder