Class HeadlessDialog
Namespace: Neon.Tailwind
Assembly: Neon.Tailwind.dll
Syntax
public class HeadlessDialog : ComponentBase
Constructors
HeadlessDialog()
Constructor.
Declaration
public HeadlessDialog()
Properties
Attributes
Additional attributes to be applied to the child content.
Declaration
[Parameter(CaptureUnmatchedValues = true)]
public IReadOnlyDictionary<string, object> Attributes { get; set; }
Property Value
| Type | Description |
|---|---|
| IReadOnlyDictionary<string, object> |
ChildContent
The UI content.
Declaration
[Parameter]
public RenderFragment<HeadlessDialog> ChildContent { get; set; }
Property Value
| Type | Description |
|---|---|
| RenderFragment<HeadlessDialog> |
OnClose
Called when the dialog is closed.
Declaration
[Parameter]
public EventCallback OnClose { get; set; }
Property Value
| Type | Description |
|---|---|
| EventCallback |
OnOpen
Called when the dialog is opened.
Declaration
[Parameter]
public EventCallback OnOpen { get; set; }
Property Value
| Type | Description |
|---|---|
| EventCallback |
Show
Whether the transition should run on initial mount.
Declaration
[Parameter]
public bool Show { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
State
The current
Declaration
public MenuState State { get; protected set; }
Property Value
| Type | Description |
|---|---|
| MenuState |
Methods
Close()
Closes the current HeadlessDialog
Declaration
public Task Close()
Returns
| Type | Description |
|---|---|
| Task |
Dispose()
Declaration
public void Dispose()
DisposeAsync()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources asynchronously.
Declaration
public ValueTask DisposeAsync()
Returns
| Type | Description |
|---|---|
| ValueTask | A task that represents the asynchronous dispose operation. |
HandleClickOff()
Handler for when the user clicks away from the HeadlessDialogPanel. This by default will close the HeadlessDialog.
Declaration
public Task HandleClickOff()
Returns
| Type | Description |
|---|---|
| Task |
OnAfterRenderAsync(bool)
Method invoked after each time the component has been rendered interactively and the UI has finished updating (for example, after elements have been added to the browser DOM). Any ElementReference fields will be populated by the time this runs.
This method is not invoked during prerendering or server-side rendering, because those processes are not attached to any live browser DOM and are already complete before the DOM is updated.
Note that the component does not automatically re-render after the completion of any returned Task, because that would cause an infinite render loop.
Declaration
protected override Task OnAfterRenderAsync(bool firstRender)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | firstRender | Set to |
Returns
| Type | Description |
|---|---|
| Task | A Task representing any asynchronous operation. |
Overrides
Remarks
The OnAfterRender(bool) and OnAfterRenderAsync(bool) lifecycle methods
are useful for performing interop, or interacting with values received from @ref.
Use the firstRender parameter to ensure that initialization work is only performed
once.
OnInitialized()
Method invoked when the component is ready to start, having received its initial parameters from its parent in the render tree.
Declaration
protected override void OnInitialized()
Overrides
Open()
Opens the current HeadlessDialog
Declaration
public Task Open()
Returns
| Type | Description |
|---|---|
| Task |
RegisterPanel(HeadlessDialogPanel)
Method called by a HeadlessDialogPanel to register itself with the current HeadlessDialog.
Declaration
public Task RegisterPanel(HeadlessDialogPanel item)
Parameters
| Type | Name | Description |
|---|---|---|
| HeadlessDialogPanel | item |
Returns
| Type | Description |
|---|---|
| Task |
Toggle()
Toggles the current HeadlessDialog
Declaration
public Task Toggle()
Returns
| Type | Description |
|---|---|
| Task |
UnregisterPanel(HeadlessDialogPanel)
Method called by a HeadlessDialogPanel to unregister itself with the current HeadlessDialog.
Declaration
public Task UnregisterPanel(HeadlessDialogPanel item)
Parameters
| Type | Name | Description |
|---|---|---|
| HeadlessDialogPanel | item |
Returns
| Type | Description |
|---|---|
| Task |