blazor-devexpress-dot-blazor-dot-dxwindow-dot-showatasync-x28-system-dot-string-system-dot-threading-dot-cancellationtoken-x29.md
Asynchronously shows the Window over the element specified by a selector.
Namespace : DevExpress.Blazor
Assembly : DevExpress.Blazor.v25.2.dll
NuGet Package : DevExpress.Blazor
public Task ShowAtAsync(
string elementSelector,
CancellationToken token = default(CancellationToken)
)
| Name | Type | Description |
|---|---|---|
| elementSelector | String |
An element selector.
|
| Name | Type | Default | Description |
|---|---|---|---|
| token | CancellationToken | null |
An object that propagates a cancellation notification.
|
| Type | Description |
|---|---|
| Task |
An asynchronous operation that shows the Window.
|
<DxButton RenderStyle="ButtonRenderStyle.Secondary"
Click="OnShowAtElementSelectorClick">SHOW A WINDOW</DxButton>
<div id="greenDiv" class="container"></div>
<DxWindow @ref=Window
HeaderText="Header"
BodyText="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris sit amet metus vel
nisi blandit tincidunt vel efficitur purus. Nunc nec turpis tempus, accumsan orci auctor,
imperdiet mauris. Fusce id purus magna."
Width="max(25vw, 250px)" >
</DxWindow>
@code {
DxWindow Window;
async Task OnShowAtElementSelectorClick(MouseEventArgs args) {
await Window.ShowAtAsync("#greenDiv");
}
}
.container {
width: 100px;
height: 100px;
background: #00ff00;
}
You can also use other ShowAtAsync method overloads to show the window.
Run Demo: Window - Show Options
See Also