Class TwDialogService
Default implementation of ITwDialogService.
public class TwDialogService : ITwDialogService
- Inheritance
-
TwDialogService
- Implements
- Inherited Members
Remarks
Register a TwDialogProvider once in your layout so dialogs created here can render.
Constructors
TwDialogService()
public TwDialogService()
Methods
Close(ITwDialogReference)
Closes the specified dialog with a successful, empty result.
public void Close(ITwDialogReference dialog)
Parameters
dialogITwDialogReferenceThe reference of the dialog to close.
Close(ITwDialogReference, TwDialogResult?)
Closes the specified dialog with the given result.
public virtual void Close(ITwDialogReference dialog, TwDialogResult? result)
Parameters
dialogITwDialogReferenceThe reference of the dialog to close.
resultTwDialogResultThe result to include.
CreateReference()
Creates a dialog reference without showing it.
public virtual ITwDialogReference CreateReference()
Returns
- ITwDialogReference
The created dialog reference.
ShowAsync(Type)
Displays a dialog for the specified component type.
public Task<ITwDialogReference> ShowAsync(Type component)
Parameters
componentTypeThe dialog content to display.
Returns
- Task<ITwDialogReference>
A reference to the dialog.
ShowAsync(Type, string?)
Displays a dialog for the specified component type with a custom title.
public Task<ITwDialogReference> ShowAsync(Type component, string? title)
Parameters
Returns
- Task<ITwDialogReference>
A reference to the dialog.
ShowAsync(Type, string?, TwDialogOptions)
Displays a dialog for the specified component type with a custom title and options.
public Task<ITwDialogReference> ShowAsync(Type component, string? title, TwDialogOptions options)
Parameters
componentTypeThe dialog content to display.
titlestringThe text at the top of the dialog.
optionsTwDialogOptionsThe custom display options for the dialog.
Returns
- Task<ITwDialogReference>
A reference to the dialog.
ShowAsync(Type, string?, TwDialogParameters)
Displays a dialog for the specified component type with a custom title and parameters.
public Task<ITwDialogReference> ShowAsync(Type component, string? title, TwDialogParameters parameters)
Parameters
componentTypeThe dialog content to display.
titlestringThe text at the top of the dialog.
parametersTwDialogParametersThe custom parameters to set on the dialog content.
Returns
- Task<ITwDialogReference>
A reference to the dialog.
ShowAsync(Type, string?, TwDialogParameters, TwDialogOptions)
Displays a dialog for the specified component type with a custom title, parameters, and options.
public Task<ITwDialogReference> ShowAsync(Type component, string? title, TwDialogParameters parameters, TwDialogOptions options)
Parameters
componentTypeThe dialog content to display.
titlestringThe text at the top of the dialog.
parametersTwDialogParametersThe custom parameters to set on the dialog content.
optionsTwDialogOptionsThe custom display options for the dialog.
Returns
- Task<ITwDialogReference>
A reference to the dialog.
ShowAsync<TComponent>()
Displays a dialog.
public Task<ITwDialogReference> ShowAsync<TComponent>() where TComponent : IComponent
Returns
- Task<ITwDialogReference>
A reference to the dialog.
Type Parameters
TComponentThe dialog content to display.
ShowAsync<TComponent>(string?)
Displays a dialog with a custom title.
public Task<ITwDialogReference> ShowAsync<TComponent>(string? title) where TComponent : IComponent
Parameters
titlestringThe text at the top of the dialog.
Returns
- Task<ITwDialogReference>
A reference to the dialog.
Type Parameters
TComponentThe dialog content to display.
ShowAsync<TComponent>(string?, TwDialogOptions)
Displays a dialog with a custom title and options.
public Task<ITwDialogReference> ShowAsync<TComponent>(string? title, TwDialogOptions options) where TComponent : IComponent
Parameters
titlestringThe text at the top of the dialog.
optionsTwDialogOptionsThe custom display options for the dialog.
Returns
- Task<ITwDialogReference>
A reference to the dialog.
Type Parameters
TComponentThe dialog content to display.
ShowAsync<TComponent>(string?, TwDialogParameters)
Displays a dialog with a custom title and parameters.
public Task<ITwDialogReference> ShowAsync<TComponent>(string? title, TwDialogParameters parameters) where TComponent : IComponent
Parameters
titlestringThe text at the top of the dialog.
parametersTwDialogParametersThe custom parameters to set on the dialog content.
Returns
- Task<ITwDialogReference>
A reference to the dialog.
Type Parameters
TComponentThe dialog content to display.
ShowAsync<TComponent>(string?, TwDialogParameters, TwDialogOptions?)
Displays a dialog with a custom title, parameters, and options.
public Task<ITwDialogReference> ShowAsync<TComponent>(string? title, TwDialogParameters parameters, TwDialogOptions? options) where TComponent : IComponent
Parameters
titlestringThe text at the top of the dialog.
parametersTwDialogParametersThe custom parameters to set on the dialog content.
optionsTwDialogOptionsThe custom display options for the dialog.
Returns
- Task<ITwDialogReference>
A reference to the dialog.
Type Parameters
TComponentThe dialog content to display.
ShowAsync<TComponent>(TwDialogOptions)
Displays a dialog with options.
public Task<ITwDialogReference> ShowAsync<TComponent>(TwDialogOptions options) where TComponent : IComponent
Parameters
optionsTwDialogOptionsThe custom display options for the dialog.
Returns
- Task<ITwDialogReference>
A reference to the dialog.
Type Parameters
TComponentThe dialog content to display.
ShowAsync<TComponent>(TwDialogParameters)
Displays a dialog with parameters.
public Task<ITwDialogReference> ShowAsync<TComponent>(TwDialogParameters parameters) where TComponent : IComponent
Parameters
parametersTwDialogParametersThe custom parameters to set on the dialog content.
Returns
- Task<ITwDialogReference>
A reference to the dialog.
Type Parameters
TComponentThe dialog content to display.
ShowAsync<TComponent>(TwDialogParameters, TwDialogOptions)
Displays a dialog with parameters and options.
public Task<ITwDialogReference> ShowAsync<TComponent>(TwDialogParameters parameters, TwDialogOptions options) where TComponent : IComponent
Parameters
parametersTwDialogParametersThe custom parameters to set on the dialog content.
optionsTwDialogOptionsThe custom display options for the dialog.
Returns
- Task<ITwDialogReference>
A reference to the dialog.
Type Parameters
TComponentThe dialog content to display.
Events
DialogInstanceAddedAsync
Occurs when a new dialog instance is created and needs to be rendered.
public event Func<ITwDialogReference, Task>? DialogInstanceAddedAsync
Event Type
OnDialogCloseRequested
Occurs when a request is made to close a dialog.
public event Action<ITwDialogReference, TwDialogResult?>? OnDialogCloseRequested