Table of Contents

Class TwDialogInstance

Namespace
TwBlazor.Services
Assembly
TwBlazor.dll

Provides dialog content components with access to close or cancel the dialog they are hosted in.

public sealed class TwDialogInstance
Inheritance
TwDialogInstance
Inherited Members

Remarks

Receive this via a cascading parameter in a component shown through ITwDialogService: [CascadingParameter] private TwDialogInstance? DialogInstance { get; set; }

Constructors

TwDialogInstance(ITwDialogReference)

Provides dialog content components with access to close or cancel the dialog they are hosted in.

public TwDialogInstance(ITwDialogReference reference)

Parameters

reference ITwDialogReference

Remarks

Receive this via a cascading parameter in a component shown through ITwDialogService: [CascadingParameter] private TwDialogInstance? DialogInstance { get; set; }

Properties

Id

Gets the unique identifier of the dialog.

public Guid Id { get; }

Property Value

Guid

Methods

Cancel()

Closes the dialog as canceled.

public void Cancel()

Close()

Closes the dialog with a successful, empty result.

public void Close()

Close(TwDialogResult?)

Closes the dialog with the specified result.

public void Close(TwDialogResult? result)

Parameters

result TwDialogResult

The result to return to the caller awaiting Result.

Close<T>(T)

Closes the dialog with a successful result carrying the specified data.

public void Close<T>(T data)

Parameters

data T

The data to return.

Type Parameters

T

The type of the returned data.