View.CanClose() Method

Determines whether a View can be closed.

Namespace: DevExpress.ExpressApp

Assembly: DevExpress.ExpressApp.v18.2.dll

Declaration

public bool CanClose()
Public Function CanClose As Boolean

Returns

Type Description
Boolean

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