Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

DxWindow.IsInitialized Property

Gets whether the Window component is initialized.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
public bool IsInitialized { get; }

#Property Value

Type Description
Boolean

true if the component is initialized; otherwise, false.

#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.

Razor
@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