DxWindow.IsInitialized Property
Gets whether the Window component is initialized.
Namespace: DevExpress.Blazor
Assembly: DevExpress.Blazor.v24.1.dll
NuGet Package: DevExpress.Blazor
Declaration
public bool IsInitialized { get; }
Property Value
Type | Description |
---|---|
Boolean |
|
Remarks
The Window cannot be shown until the component is initialized. The initialization starts after the component is rendered for the first time. Once this task is completed, the Created event fires.
To track the initialization state from code, use the IsInitialized
property. For example, you can check this property value before you call the ShowAsync(CancellationToken) method.
@inject IJSRuntime JsRuntime
<DxButton RenderStyle="ButtonRenderStyle.Primary" Text="Show" Click="ShowClick" />
<DxWindow @bind-Visible="@WindowVisible"
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."
ShowFooter="true"
@ref="Window">
<FooterTemplate>
<DxButton RenderStyle="ButtonRenderStyle.Primary" Text="Close" Click="CloseClick" />
</FooterTemplate>
</DxWindow>
@code {
DxWindow Window;
bool WindowVisible { get; set; } = false;
async Task ShowClick(MouseEventArgs args)
{
if (Window.IsInitialized)
await Window.ShowAsync();
else
await JsRuntime.InvokeVoidAsync("alert", "The component has not been initialized yet. Please try later.");
}
async Task CloseClick(MouseEventArgs args)
{
await Window.CloseAsync();
}
}
See Also