Occurs when a document is deselected and allows you to unbind the document from its content and dispose of the content. This event is in effect in Deferred Load mode.
public event ControlReleasingEventHandler ControlReleasing
Public Event ControlReleasing As ControlReleasingEventHandler
The ControlReleasing event's data class is ControlReleasingEventArgs. The following properties provide information specific to this event:
|Cancel||Gets or sets a value indicating whether the event should be canceled. Inherited from CancelEventArgs.|
|DisposeControl||Gets or sets whether a content object should be disposed of after it has been unbound from a document.|
|Document||The Document related to the current event. Inherited from DocumentCancelEventArgs.|
|KeepControl||Gets or sets whether a deselected Document’s content should be kept.|
When a new document is activated, the ControlReleasing event is raised for the previously selected document. By default, the event’s KeepControl parameter is set to true, retaining the content object binding to the previously selected document. This means each time a document is reselected, it does not require new content to be assigned, as it will reuse the old content object.
Set the KeepControl parameter to false to unbind the content object from the document. When this empty document needs to be redisplayed, the BaseView.QueryControl will fire, allowing you to provide a new content for this document.
If you set the KeepControl parameter to false, the unbound content object will be disposed of, by default. To prevent the content from being destroyed, set the event’s DisposeControl parameter to false. This unbound control can later be set as another document’s content when the BaseView.QueryControl event fires.
The BaseView.ControlReleased is a notification event that fires after the content has been unbound from a document. If the KeepControl parameter is set to true, the BaseView.ControlReleased event will not fire for this document.
The Cancel parameter is obsolete and should not be used. To specify whether or not the document content should be unbound, use the KeepControl parameter instead.