Table of Contents

Class MudDialogInstance

Namespace
MudBlazor
Assembly
MudBlazor.dll

An instance of a MudDialog.

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

Remarks

When a MudDialog is shown, a new instance is created. This instance can then be used to perform actions such as hiding the dialog programmatically.

Constructors

MudDialogInstance()

public MudDialogInstance()
See Also

Properties

BackgroundClassname

protected string BackgroundClassname { get; set; }

Property Value

string
See Also

Classname

protected string Classname { get; }

Property Value

string
See Also

CloseIcon

The custom icon displayed in the upper-right corner for closing this dialog.

[Parameter]
[Category("Appearance")]
public string CloseIcon { get; set; }

Property Value

string

Remarks

Defaults to Close.

See Also

Content

The content within this dialog.

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

Property Value

RenderFragment

Remarks

Defaults to the content of the MudDialog being displayed.

See Also

Id

The unique ID for this instance.

[Parameter]
[Category("Behavior")]
public Guid Id { get; set; }

Property Value

Guid
See Also

Options

The options used for this dialog.

[Parameter]
[Category("Misc")]
public DialogOptions Options { get; set; }

Property Value

DialogOptions

Remarks

Defaults to the options in the MudDialog or options passed during ShowAsync(Type) methods.

See Also

RightToLeft

[CascadingParameter(Name = "RightToLeft")]
public bool RightToLeft { get; set; }

Property Value

bool
See Also

Title

The text displayed at the top of this dialog if TitleContent is not set.

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

Property Value

string
See Also

TitleClassname

protected string TitleClassname { get; }

Property Value

string
See Also

TitleContent

The custom content at the top of this dialog.

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

Property Value

RenderFragment

Remarks

This content will display so long as Title is not set.

See Also

Methods

BuildRenderTree(RenderTreeBuilder)

protected override void BuildRenderTree(RenderTreeBuilder __builder)

Parameters

__builder RenderTreeBuilder
See Also

Cancel()

Closes this dialog with a result of DialogResult.Cancel.

public void Cancel()
See Also

CancelAll()

Closes this dialog and any parent dialogs.

public void CancelAll()
See Also

Close()

Closes this dialog with a result of DialogResult.Ok.

public void Close()
See Also

Close(DialogResult)

Closes this dialog with a custom result.

public void Close(DialogResult dialogResult)

Parameters

dialogResult DialogResult

The result to include, such as Ok<T>(T) or Cancel().

See Also

Close<T>(T)

Closes this dialog with a custom return value.

public void Close<T>(T returnValue)

Parameters

returnValue T

The custom value to include.

Type Parameters

T

The type of value being returned.

See Also

Dispose()

Releases resources used by this dialog.

public void Dispose()
See Also

Dispose(bool)

protected virtual void Dispose(bool disposing)

Parameters

disposing bool
See Also

OnAfterRenderAsync(bool)

protected override Task OnAfterRenderAsync(bool firstRender)

Parameters

firstRender bool

Returns

Task
See Also

OnInitialized()

protected override void OnInitialized()
See Also

Register(MudDialog)

Links a dialog with this instance.

public void Register(MudDialog dialog)

Parameters

dialog MudDialog

The dialog to use.

Remarks

This method is used internally when displaying a new dialog.

See Also

SetOptions(DialogOptions)

Overwrites the current dialog options.

public void SetOptions(DialogOptions options)

Parameters

options DialogOptions

The new dialog options to use.

Remarks

Use this method to change options while a dialog is open, such as toggling fullscreen mode.

See Also

SetTitle(string)

Overwrites the dialog title.

public void SetTitle(string title)

Parameters

title string

The new dialog title to use.

Remarks

Use this method to change the title while a dialog is open, such as when the title reflects a value within this dialog. Has no effect when TitleContent is set.

See Also

StateHasChanged()

public void StateHasChanged()
See Also

See Also