Back to Devexpress

DxWindow.Visible Property

blazor-devexpress-dot-blazor-dot-dxwindow.md

latest2.6 KB
Original Source

DxWindow.Visible Property

Specifies whether the Window is visible.

Namespace : DevExpress.Blazor

Assembly : DevExpress.Blazor.v25.2.dll

NuGet Package : DevExpress.Blazor

Declaration

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

Property Value

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

razor
<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;
}

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

DxWindow Class

DxWindow Members

DevExpress.Blazor Namespace