Skip to main content
.NET Framework 4.5.2+

View.Closing Event

Occurs when closing a View.

Namespace: DevExpress.ExpressApp

Assembly: DevExpress.ExpressApp.v24.1.dll

NuGet Package: DevExpress.ExpressApp

Declaration

public event EventHandler Closing

Event Data

The Closing event's data class is EventArgs.

Remarks

To release additional resources used by the View which will be closed, handle the Closing event.

This event occurs in the following cases:

  • In a Windows Forms application, when a Window that contains the current View is closed.
  • In any application, when the current View is replaced with another View.

If you need to keep the View open when a user attempts to close it, handle the View.QueryCanClose event and set the CancelEventArgs.Cancel parameter to true.

Note

XAF does not trigger the QueryCanClose event in ASP.NET Core Blazor applications. Use the DevExpress.ExpressApp.Blazor.BlazorWindow.Closing event to prohibit closing a View under certain conditions.

See Also