blazor-devexpress-dot-blazor-dot-dxflyout-dot-showasync-x28-system-dot-threading-dot-cancellationtoken-x29.md
Asynchronously shows the flyout window.
Namespace : DevExpress.Blazor
Assembly : DevExpress.Blazor.v25.2.dll
NuGet Package : DevExpress.Blazor
public Task<bool> ShowAsync(
CancellationToken token = default(CancellationToken)
)
| Name | Type | Default | Description |
|---|---|---|---|
| token | CancellationToken | null |
An object that propagates a cancellation notification.
|
| Type | Description |
|---|---|
| Task<Boolean> |
An asynchronous operation that shows the window. The operation returns true if the operation is successful; otherwise, false.
|
Call the ShowAsync and CloseAsync methods to show and close the flyout window asynchronously.
If you call the ShowAsync method before the window is initialized, the operation returns false. You can use the IsInitialized property to check the initialization state. Run the InitializedTask task to wait until the flyout window is initialized.
<DxButton Text="Show" Click="ShowWindow" aria-describedby="flyout" />
<DxButton Text="Hide" Click="HideWindow" />
<DxFlyout Id="flyout" @ref="flyoutWindow" Width="400" CloseOnOutsideClick="false"
BodyText="Lorem ipsum dolor sit amet, consectetur adipiscing elit." />
@code {
DxFlyout flyoutWindow { get; set; }
async Task ShowWindow(MouseEventArgs args) {
if (!flyoutWindow.IsInitialized)
await flyoutWindow.InitializedTask;
await flyoutWindow.ShowAsync();
}
async Task HideWindow(MouseEventArgs args) {
await flyoutWindow.CloseAsync();
}
}
You can handle the following events related to ShowAsync and CloseAsync methods:
ShowingFires before the flyout window is displayed.ShownFires after the flyout window is displayed.ClosingFires before the flyout window is closed.ClosedFires after the flyout window is closed.
To show and close the flyout window synchronously, implement two-way binding for the IsOpen property.
See Also