.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+
.NET Core 3.0+

View.CanClose() Method

Determines whether a View can be closed.

Namespace: DevExpress.ExpressApp

Assembly: DevExpress.ExpressApp.v20.2.dll


public bool CanClose()


Type Description

true if the current View can be closed; otherwise, false.


Use this method to check whether a View is allowed to be closed. If the current View is not root (it is created in another View’s Object Space), this method returns true. Otherwise, it raises the View.QueryCanClose event and returns the opposite value of the handler’s CancelEventArgs.Cancel parameter. Handle this event to prohibit closing a View under specific conditions.

This method is used internally, when closing a Window in a Windows Forms application and when replacing a View with another.

See Also