Skip to main content
All docs
V25.1
  • DxWindow.ShowCloseButton Property

    Specifies whether the Window’s header displays the Close button.

    Namespace: DevExpress.Blazor

    Assembly: DevExpress.Blazor.v25.1.dll

    NuGet Package: DevExpress.Blazor

    Declaration

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

    Property Value

    Type Description
    Boolean

    true to display the Close button; otherwise, false.

    Remarks

    Set the ShowCloseButton property to true to show the Close button in the header. Users can click this button or press Escape to close the window.

    <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)"
              ShowCloseButton=true>
    </DxWindow>
    
    @code {
        bool WindowVisible { get; set; } = false;
    }
    

    Blazor Window - Show Close Button

    You can also use the following templates to implement a custom close action: HeaderTemplate, BodyTemplate, FooterTemplate. In a template, use the context parameter’s CloseCallback property.

    See Also