Table of Contents

Class DialogReference

Namespace
MudBlazor
Assembly
MudBlazor.dll

An instance of a MudDialog.

public class DialogReference : IDialogReference
Inheritance
DialogReference
Implements
Inherited Members
Extension Methods

Constructors

DialogReference(Guid, IDialogService)

Creates a new instance.

public DialogReference(Guid dialogInstanceId, IDialogService dialogService)

Parameters

dialogInstanceId Guid

The unique ID of the dialog.

dialogService IDialogService

The service used to manage dialogs.

Properties

Dialog

The dialog linked to this reference.

public object? Dialog { get; }

Property Value

object

Id

The unique ID of this dialog.

public Guid Id { get; }

Property Value

Guid

RenderFragment

The content within this dialog.

public RenderFragment? RenderFragment { get; set; }

Property Value

RenderFragment

Result

The result of closing the dialog.

public Task<DialogResult?> Result { get; }

Property Value

Task<DialogResult>

Methods

Close()

Hides the dialog.

public void Close()

Close(DialogResult?)

Hides the dialog and returns a result.

public void Close(DialogResult? result)

Parameters

result DialogResult

The result of closing the dialog.

Dismiss(DialogResult?)

Notifies that this dialog has been dismissed.

public virtual bool Dismiss(DialogResult? result)

Parameters

result DialogResult

The result of closing the dialog.

Returns

bool

Returns true if the result was set successfully.

GetReturnValueAsync<T>()

Gets the result of closing the dialog.

public Task<T?> GetReturnValueAsync<T>()

Returns

Task<T>

The results of closing the dialog.

Type Parameters

T

The type of value to return.

InjectDialog(object)

Replaces the dialog with the specified reference.

public void InjectDialog(object inst)

Parameters

inst object

The new dialog to use.

InjectRenderFragment(RenderFragment)

Replaces the dialog content.

public void InjectRenderFragment(RenderFragment rf)

Parameters

rf RenderFragment

The new content to use.

See Also