Table of Contents

Class MudOverlay

Namespace
MudBlazor
Assembly
MudBlazor.dll

A layer which darkens a window, often as part of showing a MudDialog.

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

Constructors

MudOverlay()

public MudOverlay()

Properties

Absolute

Uses absolute positioning for the overlay.

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

Property Value

bool

Remarks

Defaults to false.

AutoClose

Sets Visible to false when the overlay is clicked and calls OnClosed.

[Parameter]
[Category("Click action")]
public bool AutoClose { get; set; }

Property Value

bool

Remarks

Defaults to false. This is preferred over the previously used OnClick event.

ChildContent

Child content of the component.

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

Property Value

RenderFragment

Remarks

Defaults to null.

Classname

protected string Classname { get; }

Property Value

string

DarkBackground

Applies the theme's dark overlay color.

[Parameter]
[Category("Appearance")]
public bool DarkBackground { get; set; }

Property Value

bool

Remarks

Defaults to false.

LightBackground

Applies the theme's light overlay color.

[Parameter]
[Category("Appearance")]
public bool LightBackground { get; set; }

Property Value

bool

Remarks

Defaults to false.

LockScroll

Prevents the Document.body element from scrolling.

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

Property Value

bool

Remarks

Defaults to true.

LockScrollClass

The css class that will be added to body if lockscroll is used.

[Parameter]
[Category("Behavior")]
public string LockScrollClass { get; set; }

Property Value

string

Remarks

Defaults to "scroll-locked".

OnClick

Occurs when the overlay is clicked.

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

Property Value

EventCallback<MouseEventArgs>

Remarks

If you need to close the overlay automatically, you can use AutoClose and OnClosed instead.

OnClosed

Occurs when the overlay is closed due to AutoClose.

[Parameter]
public EventCallback OnClosed { get; set; }

Property Value

EventCallback

ScrimClassname

protected string ScrimClassname { get; }

Property Value

string

ScrollManager

The manager for scroll events.

[Inject]
public IScrollManager ScrollManager { get; set; }

Property Value

IScrollManager

Styles

protected string Styles { get; }

Property Value

string

Visible

Makes the overlay visible.

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

Property Value

bool

Remarks

Defaults to false.

VisibleChanged

Occurs when Visible changes.

[Parameter]
public EventCallback<bool> VisibleChanged { get; set; }

Property Value

EventCallback<bool>

Remarks

This event is triggered when the visibility of the overlay changes.

ZIndex

Sets the z-index of the overlay.

[Parameter]
[Category("Behavior")]
public int ZIndex { get; set; }

Property Value

int

Remarks

Defaults to 5.

Methods

BuildRenderTree(RenderTreeBuilder)

protected override void BuildRenderTree(RenderTreeBuilder __builder)

Parameters

__builder RenderTreeBuilder

DisposeAsync()

public ValueTask DisposeAsync()

Returns

ValueTask

OnAfterRenderAsync(bool)

protected override Task OnAfterRenderAsync(bool firstTime)

Parameters

firstTime bool

Returns

Task

OnClickHandlerAsync(MouseEventArgs)

protected Task OnClickHandlerAsync(MouseEventArgs ev)

Parameters

ev MouseEventArgs

Returns

Task