Back to Devexpress

DockLayoutManager.ShowingDockHints Event

wpf-devexpress-dot-xpf-dot-docking-dot-docklayoutmanager-febbbd41.md

latest7.0 KB
Original Source

DockLayoutManager.ShowingDockHints Event

Allows you to disable individual dock guides and hide specific dock hints based on a condition.

Namespace : DevExpress.Xpf.Docking

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

NuGet Package : DevExpress.Wpf.Docking

Declaration

csharp
public event ShowingDockHintsEventHandler ShowingDockHints
vb
Public Event ShowingDockHints As ShowingDockHintsEventHandler

Event Data

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

PropertyDescription
DraggingSourceGets the dragged item’s owner.
DraggingTargetGets the target of the dragged item.
HandledGets 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.
OriginalSourceGets the original reporting source as determined by pure hit testing, before any possible Source adjustment by a parent class. Inherited from RoutedEventArgs.
RoutedEventGets or sets the RoutedEvent associated with this RoutedEventArgs instance. Inherited from RoutedEventArgs.
SourceGets or sets a reference to the object that raised the event. Inherited from RoutedEventArgs.

The event data class exposes the following methods:

MethodDescription
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

When a user drags a dock item over dock panels, the DockLayoutManager displays the following dock guides: left, top, right, bottom, and central. Dock guides display hints (for example, the central dock guide displays five hints: Center, CenterBottom, CenterLeft, CenterRight, and CenterTop).

Handle the ShowingDockHints event to disable individual dock guides and hide specific dock hints based on a condition. Use the following methods: e.DisableAll, e.Disable, e.HideAll, and e.Hide. The e.DraggingTarget event parameter identifies the dragged dock panel.

csharp
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;
    }
    // Disable all Dock Hints while dragging over Panel3
    if(object.Equals(e.DraggingTarget, Panel3)) {
        e.DisableAll();
        return;
    }
    // Disable and hide specific 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;
    }
}

Warning

Dock Hints are rendered on a transparent window, which may not function correctly on systems with transparency-related optimizations, such as Citrix. Issues may include invisible or disappearing Dock Hints.

See Also

DockLayoutManager Class

DockLayoutManager Members

DevExpress.Xpf.Docking Namespace