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
Remarks
Defaults to false
.
AutoClose
[Parameter]
[Category("Click action")]
public bool AutoClose { get; set; }
Property Value
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
Remarks
Defaults to null
.
Classname
protected string Classname { get; }
Property Value
DarkBackground
Applies the theme's dark overlay color.
[Parameter]
[Category("Appearance")]
public bool DarkBackground { get; set; }
Property Value
Remarks
Defaults to false
.
LightBackground
Applies the theme's light overlay color.
[Parameter]
[Category("Appearance")]
public bool LightBackground { get; set; }
Property Value
Remarks
Defaults to false
.
LockScroll
Prevents the Document.body
element from scrolling.
[Parameter]
[Category("Behavior")]
public bool LockScroll { get; set; }
Property Value
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
Remarks
Defaults to "scroll-locked"
.
OnClick
Occurs when the overlay is clicked.
[Parameter]
public EventCallback<MouseEventArgs> OnClick { get; set; }
Property Value
Remarks
OnClosed
Occurs when the overlay is closed due to AutoClose.
[Parameter]
public EventCallback OnClosed { get; set; }
Property Value
ScrimClassname
protected string ScrimClassname { get; }
Property Value
ScrollManager
The manager for scroll events.
[Inject]
public IScrollManager ScrollManager { get; set; }
Property Value
Styles
protected string Styles { get; }
Property Value
Visible
Makes the overlay visible.
[Parameter]
[Category("Behavior")]
public bool Visible { get; set; }
Property Value
Remarks
Defaults to false
.
VisibleChanged
Occurs when Visible changes.
[Parameter]
public EventCallback<bool> VisibleChanged { get; set; }
Property Value
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
Remarks
Defaults to 5
.
Methods
BuildRenderTree(RenderTreeBuilder)
protected override void BuildRenderTree(RenderTreeBuilder __builder)
Parameters
__builder
RenderTreeBuilder
DisposeAsync()
public ValueTask DisposeAsync()
Returns
OnAfterRenderAsync(bool)
protected override Task OnAfterRenderAsync(bool firstTime)
Parameters
firstTime
bool
Returns
OnClickHandlerAsync(MouseEventArgs)
protected Task OnClickHandlerAsync(MouseEventArgs ev)