Skip to main content

DxWindow.Visible Property

Specifies whether the Window is visible.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v23.2.dll

NuGet Package: DevExpress.Blazor

Declaration

[Parameter]
public bool Visible { get; set; }

Property Value

Type Description
Boolean

true if the Window is displayed; otherwise, false.

Remarks

Implement two-way binding for the Visible property to show the Window in code and update the property value when a user closes the Window. The VisibleChanged event occurs when the property value changes.

<DxButton RenderStyle="ButtonRenderStyle.Secondary" 
          Click="() => WindowVisible = !WindowVisible">SHOW A WINDOW</DxButton>
<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."
          Width="max(25vw, 250px)">
</DxWindow>

@code {
    bool WindowVisible { get; set; } = false;
}

Blazor Window

Run Demo: Window - Overview

You can handle the following events related to the Visible property’s changes:

  • Showing - Fires before the Window is displayed and allows you to cancel this action.
  • Shown - Fires after the Window is displayed.
  • Closing - Fires before the Window is closed and allows you to cancel this action.
  • Closed - Fires after the Window is closed.

The ShowAsync and CloseAsync methods allow you to show and close the Window asynchronously.

See Also