Skip to main content
.NET Framework 4.6.2+

View.CanClose() Method

Determines whether a View can be closed.

Namespace: DevExpress.ExpressApp

Assembly: DevExpress.ExpressApp.v24.2.dll

NuGet Package: DevExpress.ExpressApp

Declaration

public bool CanClose()

Returns

Type Description
Boolean

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

Remarks

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