blazor-devexpress-dot-blazor-dot-dxwindow-4979022e.md
Specifies whether the Window should close when a user presses Escape.
Namespace : DevExpress.Blazor
Assembly : DevExpress.Blazor.v25.2.dll
NuGet Package : DevExpress.Blazor
[DefaultValue(true)]
[Parameter]
public bool CloseOnEscape { get; set; }
| Type | Default | Description |
|---|---|---|
| Boolean | true |
trueto close the Window when a user presses Escape; otherwise; false
|
Users can close the Window in the following ways:
true to show this button.CloseOnEscape property to false to disable this capability. The following code snippet demonstrates this.<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"
CloseOnEscape=false>
</DxWindow>
@code {
bool WindowVisible { get; set; } = false;
}
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