Interface ITwDialogReference
A handle to an active dialog instance shown via ITwDialogService.
public interface ITwDialogReference
Properties
Dialog
Gets the dialog content component instance, once rendered.
object? Dialog { get; }
Property Value
Id
Gets the unique identifier of this dialog.
Guid Id { get; }
Property Value
Options
Gets the options used to display this dialog.
TwDialogOptions? Options { get; }
Property Value
RenderCompleteTaskCompletionSource
Gets a task source that completes once the dialog has rendered for the first time.
TaskCompletionSource<bool> RenderCompleteTaskCompletionSource { get; }
Property Value
RenderFragment
Gets or sets the rendered content of the dialog.
RenderFragment? RenderFragment { get; set; }
Property Value
Result
Gets a task that completes with the result once the dialog closes.
Task<TwDialogResult?> Result { get; }
Property Value
Title
Gets the title displayed in the dialog header.
string? Title { get; }
Property Value
Methods
Close()
Closes the dialog with a successful, empty result.
void Close()
Close(TwDialogResult?)
Closes the dialog with the specified result.
void Close(TwDialogResult? result)
Parameters
resultTwDialogResultThe result to complete Result with.
Dismiss(TwDialogResult?)
Marks the dialog as dismissed, completing Result.
bool Dismiss(TwDialogResult? result)
Parameters
resultTwDialogResultThe result to complete Result with.
Returns
- bool
trueif this call set the result;falseif it was already set.
GetReturnValueAsync<T>()
Gets the result data cast to T, once the dialog closes.
Task<T?> GetReturnValueAsync<T>()
Returns
- Task<T>
Type Parameters
TThe expected type of the returned data.
InjectDialog(object)
Assigns the dialog content component instance.
void InjectDialog(object instance)
Parameters
instanceobjectThe rendered dialog content component.
InjectOptions(TwDialogOptions)
Assigns the options used to display this dialog.
void InjectOptions(TwDialogOptions options)
Parameters
optionsTwDialogOptionsThe options to use.
InjectRenderFragment(RenderFragment)
Replaces the rendered content of the dialog.
void InjectRenderFragment(RenderFragment renderFragment)
Parameters
renderFragmentRenderFragmentThe new content to render.
InjectTitle(string?)
Assigns the title displayed in the dialog header.
void InjectTitle(string? title)
Parameters
titlestringThe title to display.