Skip to main content

DockLayoutManager.DockOperationStarting Event

Occurs whenever a docking operation within the current DockLayoutManager is performed.

Namespace: DevExpress.Xpf.Docking

Assembly: DevExpress.Xpf.Docking.v24.2.dll

NuGet Package: DevExpress.Wpf.Docking

Declaration

public event DockOperationStartingEventHandler DockOperationStarting

Event Data

The DockOperationStarting event's data class is DockOperationStartingEventArgs. The following properties provide information specific to this event:

Property Description
Cancel Gets or sets whether the current operation must be canceled. Inherited from ItemCancelEventArgs.
DockOperation Gets the type of an operation that is processed within the DockLayoutManager.DockOperationStarting event.
DockTarget Gets a Dock Item to which the current Dock Item is to be docked.
Handled Gets or sets a value that indicates the present state of the event handling for a routed event as it travels the route. Inherited from RoutedEventArgs.
Item Gets the currently processed item. Inherited from ItemEventArgs.
OriginalSource Gets the original reporting source as determined by pure hit testing, before any possible Source adjustment by a parent class. Inherited from RoutedEventArgs.
RoutedEvent Gets or sets the RoutedEvent associated with this RoutedEventArgs instance. Inherited from RoutedEventArgs.
Source Gets or sets a reference to the object that raised the event. Inherited from RoutedEventArgs.

The event data class exposes the following methods:

Method Description
InvokeEventHandler(Delegate, Object) When overridden in a derived class, provides a way to invoke event handlers in a type-specific way, which can increase efficiency over the base implementation. Inherited from RoutedEventArgs.
OnSetSource(Object) When overridden in a derived class, provides a notification callback entry point whenever the value of the Source property of an instance changes. Inherited from RoutedEventArgs.

Remarks

The DockOperationStarting event is fired when a Dock Item within the current DockLayoutManager is to be docked, auto-hidden, closed, restored or made floating. Handling this event allows you to enable or cancel certain upcoming layout modifications.

The DockOperationStarting event receives an argument of the DockOperationStartingEventArgs type. Its properties allow you to determine which Dock Item is being modified, what type of operation is going to happen, and depending on this information, allow or prohibit the current operation. For example, the following code prohibits the dockPanel2 from being docked via a double mouse click on its header:

private void WindowContainer_DockOperationStarting(object sender, DevExpress.Xpf.Docking.Base.DockOperationStartingEventArgs e) {
    if (e.Item == dockPanel2 && e.DockOperation == DevExpress.Xpf.Docking.DockOperation.Dock && e.DockTarget == null) e.Cancel = true;
}

If the DockOperationStarting event is not canceled, it’s followed by the DockLayoutManager.DockOperationCompleted event.

See Also