Skip to main content

BaseLayoutItem.AllowDockToCurrentItem Property

Gets or sets whether a panel can be merged as a tab into the current item. This is a dependency property.

Namespace: DevExpress.Xpf.Docking

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

NuGet Package: DevExpress.Wpf.Docking

Declaration

public bool AllowDockToCurrentItem { get; set; }

Property Value

Type Description
Boolean

true, if a panel can be merged as a tab into the current item; otherwise, false. The default is true.

Remarks

By default, when the AllowDockToCurrentItem property is set to true, it is allowed to merge a LayoutPanel as a tab into the current BaseLayoutItem, where the current BaseLayoutItem is a LayoutGroup, TabbedGroup or another LayoutPanel.

In code, you can merge a panel as a tab using the DockControllerBase.Dock method, setting the type parameter to DockType.Fill. At run time, an end-user can merge a panel as a tab using the center button of the docking hint displayed while dragging the panel. Below is a sample markup and an image illustrating the corresponding behavior at run time.

xmlns:dxdo="http://schemas.devexpress.com/winfx/2008/xaml/docking"

<dxdo:DockLayoutManager>
    <dxdo:LayoutGroup Caption="LayoutRoot">
        <dxdo:LayoutPanel Caption="Panel1"/>
        <dxdo:LayoutPanel Caption="Panel2"/>
        <dxdo:TabbedGroup>
            <dxdo:LayoutPanel Caption="Panel3"/>
            <dxdo:LayoutPanel Caption="Panel4"/>
        </dxdo:TabbedGroup>
    </dxdo:LayoutGroup>
</dxdo:DockLayoutManager>

BaseLayoutItem|_AllowDockToCurrentItem

Set the AllowDockToCurrentItem property to false to prohibit merging other panels as tabs into the current BaseLayoutItem either in code, or at run time. In the code snippet below, it is not allowed to dock panels as tabs to the tabbed group.

xmlns:dxdo="http://schemas.devexpress.com/winfx/2008/xaml/docking"

<dxdo:DockLayoutManager>
    <dxdo:LayoutGroup Caption="LayoutRoot">
        <dxdo:LayoutPanel Caption="Panel1"/>
        <dxdo:LayoutPanel Caption="Panel2"/>
        <dxdo:TabbedGroup AllowDockToCurrentItem="False">
            <dxdo:LayoutPanel Caption="Panel3"/>
            <dxdo:LayoutPanel Caption="Panel4"/>
        </dxdo:TabbedGroup>
    </dxdo:LayoutGroup>
</dxdo:DockLayoutManager>

The center button of the dock hint is not displayed at run time in this case. See the figure below.

BaseLayoutItem|_AllowDockToCurrentItem_False

See Also