Skip to main content
A newer version of this page is available. .

DockLayoutManager.ShowingDockHints Event

Allows you to hide and disable individual dock hints.

Namespace: DevExpress.Xpf.Docking

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

NuGet Packages: DevExpress.WindowsDesktop.Wpf.Docking, DevExpress.Wpf.Navigation

Declaration

public event ShowingDockHintsEventHandler ShowingDockHints

Event Data

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

Property Description
DraggingSource Gets the dragged item’s owner.
DraggingTarget Gets the target of the dragged item.
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.
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
Disable(DockHint) Disables the DockHint.
DisableAll() Disables all DockHints.
GetIsEnabled(DockHint) Gets whether the DockHint item is enabled.
GetIsVisible(DockGuide) Gets whether the DockGuide item is visible.
Hide(DockGuide) Hides the DockGuide item.
Hide(DockHint) Hides the DockHint item.
HideAll() Hides all DockGuides.
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 event fires when you drag a dock item over the dock UI. Dock hints are displayed while dragging, helping an end-user decide where to drop the item.

When an end user drags a dock item over dock panels, the following Dock Guides are displayed: left, top, right, bottom and central:

DockGuides

Each DockGuide consists of a number of DockHints. For example, the central DockGuide consists of five DockHints: Center, CenterBottom, CenterLeft, CenterRight and CenterTop. The left Dock Guide consists of two Dock Hints: SideLeft and AutoHideLeft, etc.

Use the following ShowingDockHints event argument’s methods to disable individual Dock Guides and hide specific Dock Hints, according to your logic: DisableAll, Disable, HideAll, Hide.

The following example shows how to handle the ShowingDockHints event:

void OnShowingDockHints(object sender, ShowingDockHintsEventArgs e) {
    // Hide all Dock Guides while dragging a panel over Panel1
    if(object.Equals(e.DraggingTarget, Panel1)) {
        e.HideAll();
        return;
    }
    // Do not do anything while dragging over Panel2
    if(object.Equals(e.DraggingTarget, Panel2)) {
        return;
    }
    // Disable all Dock Hints while dragging over Panel3
    if(object.Equals(e.DraggingTarget, Panel3)) {
        e.DisableAll();
        return;
    }
    // Disable and hide individual Dock Hints and Dock Guides while dragging over Panel4
    if(object.Equals(e.DraggingTarget, Panel4)) {
        e.Disable(DockHint.SideLeft);
        e.Disable(DockHint.AutoHideLeft);
        e.Disable(DockHint.CenterLeft);
        e.Disable(DockHint.CenterRight);
        e.Hide(DockGuide.Top);
        e.Hide(DockGuide.Bottom);
        return;
    }
}
See Also