Skip to main content
.NET 8.0+

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

View.Closing Event

Occurs when closing a View.

Namespace: DevExpress.ExpressApp

Assembly: DevExpress.ExpressApp.v24.2.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