Class MudDialog
- Namespace
- MudBlazor
- Assembly
- MudBlazor.dll
An overlay providing the user with information, a choice, or other input.
public class MudDialog : MudComponentBase, IComponent, IHandleEvent, IHandleAfterRender, IMudStateHasChanged
- Inheritance
-
MudDialog
- Implements
- Inherited Members
- Extension Methods
Constructors
MudDialog()
Creates a new instance.
public MudDialog()
- See Also
Properties
ActionsClass
The CSS classes applied to the action buttons content.
[Parameter]
[Category("Appearance")]
public string? ActionsClass { get; set; }
Property Value
Remarks
Multiple classes must be separated by spaces.
- See Also
ActionsClassname
protected string ActionsClassname { get; }
Property Value
- See Also
ContentClass
The CSS classes applied to the main dialog content.
[Parameter]
[Category("Appearance")]
public string? ContentClass { get; set; }
Property Value
Remarks
Multiple classes must be separated by spaces.
- See Also
ContentClassname
protected string ContentClassname { get; }
Property Value
- See Also
ContentStyle
The CSS styles applied to the main dialog content.
[Parameter]
[Category("Appearance")]
public string? ContentStyle { get; set; }
Property Value
- See Also
DefaultFocus
The element which will receive focus when this dialog is shown.
[Parameter]
[Category("Behavior")]
public DefaultFocus DefaultFocus { get; set; }
Property Value
Remarks
Defaults to DefaultFocus.
- See Also
DialogActions
The custom actions for this dialog.
[Parameter]
[Category("Behavior")]
public RenderFragment? DialogActions { get; set; }
Property Value
- See Also
DialogContent
The main content for this dialog.
[Parameter]
[Category("Behavior")]
public RenderFragment? DialogContent { get; set; }
Property Value
- See Also
DialogService
[Inject]
protected IDialogService DialogService { get; set; }
Property Value
- See Also
Gutters
Adds padding to the sides of this dialog.
[Parameter]
[Category("Appearance")]
public bool Gutters { get; set; }
Property Value
Remarks
Defaults to true
.
- See Also
OnBackdropClick
Occurs when the area outside the dialog has been clicked if BackdropClick is true
.
[Parameter]
[Category("Behavior")]
public EventCallback<MouseEventArgs> OnBackdropClick { get; set; }
Property Value
Remarks
When set, this event will be called instead of the default backdrop click behavior of closing the dialog.
- See Also
Options
The default options for this dialog.
[Parameter]
[Category("Misc")]
public DialogOptions? Options { get; set; }
Property Value
Remarks
These options are used if none are provided during the ShowAsync(string?, DialogOptions?) method. This is typically used for inline dialogs.
- See Also
TitleClass
The CSS classes to apply to the title.
[Parameter]
[Category("Appearance")]
public string? TitleClass { get; set; }
Property Value
Remarks
Multiple classes must be separated by spaces.
- See Also
TitleContent
The custom content for this dialog's title.
[Parameter]
[Category("Behavior")]
public RenderFragment? TitleContent { get; set; }
Property Value
Remarks
When null
, the Title will be used.
- See Also
Visible
For inline dialogs, shows this dialog.
[Parameter]
[Category("Behavior")]
public bool Visible { get; set; }
Property Value
Remarks
Defaults to false
.
This can be bound via @bind-Visible
to show or hide inline dialogs. For regular dialogs, use the ShowAsync(Type) and Close() methods.
- See Also
VisibleChanged
Occurs when Visible has changed.
[Parameter]
public EventCallback<bool> VisibleChanged { get; set; }
Property Value
- See Also
Methods
BuildRenderTree(RenderTreeBuilder)
protected override void BuildRenderTree(RenderTreeBuilder __builder)
Parameters
__builder
RenderTreeBuilder
- See Also
CloseAsync(DialogResult?)
For inlined dialogs, hides this dialog.
public Task CloseAsync(DialogResult? result = null)
Parameters
result
DialogResultThe optional data to include.
Returns
- See Also
OnAfterRenderAsync(bool)
protected override Task OnAfterRenderAsync(bool firstRender)
Parameters
firstRender
bool
Returns
- See Also
OnInitialized()
protected override void OnInitialized()
- See Also
ShowAsync(string?, DialogOptions?)
For inlined dialogs, shows this dialog.
public Task<IDialogReference> ShowAsync(string? title = null, DialogOptions? options = null)
Parameters
title
stringThe title of this dialog.
options
DialogOptionsThe options for this dialog.
Returns
- Task<IDialogReference>
The reference to the displayed instance of this dialog.
- See Also