Table of Contents

Interface IMudDialogInstance

Namespace
MudBlazor
Assembly
MudBlazor.dll
public interface IMudDialogInstance
Extension Methods

Properties

ElementId

The unique HTML element ID of the dialog container (mud-dialog-container).

string ElementId { get; }

Property Value

string

Id

The unique ID for this instance.

Guid Id { get; }

Property Value

Guid

Options

The options used for this dialog.

DialogOptions Options { get; }

Property Value

DialogOptions

Remarks

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

Title

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

string? Title { get; }

Property Value

string

Methods

Cancel()

Closes this dialog with a result of DialogResult.Cancel.

void Cancel()

CancelAll()

Closes this dialog and any parent dialogs.

void CancelAll()

Close()

Closes this dialog with a result of DialogResult.Ok.

void Close()

Close(DialogResult)

Closes this dialog with a custom result.

void Close(DialogResult dialogResult)

Parameters

dialogResult DialogResult

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

Close<T>(T)

Closes this dialog with a custom return value.

void Close<T>(T returnValue)

Parameters

returnValue T

The custom value to include.

Type Parameters

T

The type of value being returned.

SetOptionsAsync(DialogOptions)

Overwrites the current dialog options.

Task SetOptionsAsync(DialogOptions options)

Parameters

options DialogOptions

The new dialog options to use.

Returns

Task

Remarks

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

SetTitleAsync(string?)

Overwrites the dialog title.

Task SetTitleAsync(string? title)

Parameters

title string

The new dialog title to use.

Returns

Task

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.

StateHasChanged()

Notifies the component that its state has changed. When applicable, this will cause the component to be re-rendered.

void StateHasChanged()