Back to Devexpress

TabbedGroup Class

wpf-devexpress-dot-xpf-dot-docking-443221cc.md

latest14.3 KB
Original Source

TabbedGroup Class

A tabbed group of dock panels (LayoutPanel objects).

Namespace : DevExpress.Xpf.Docking

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

NuGet Package : DevExpress.Wpf.Docking

Declaration

csharp
public class TabbedGroup :
    LayoutGroup
vb
Public Class TabbedGroup
    Inherits LayoutGroup

Remarks

The TabbedGroup object displays its child items as tab pages:

Note

TabbedGroups display tabs only at the container’s bottom. Use the DocumentGroup class to display tabs at the top.

Create TabbedGroups

In XAML

The following code sample creates a TabbedGroup that contains three LayoutPanels:

xaml
<dx:ThemedWindow
  ...
  xmlns:dxdo="http://schemas.devexpress.com/winfx/2008/xaml/docking"
  xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core">
  <dxdo:DockLayoutManager>
    <dxdo:LayoutGroup Caption="LayoutRoot">
      <dxdo:TabbedGroup>
        <dxdo:LayoutPanel Caption="Error List"/>
        <dxdo:LayoutPanel Caption="Output"/>
        <dxdo:LayoutPanel Caption="Find Results"/>
      </dxdo:TabbedGroup>
    </dxdo:LayoutGroup>
  </dxdo:DockLayoutManager>
</dx:ThemedWindow>

In Code

The following code sample creates a TabbedGroup that contains Tools, Errors, and Output LayoutPanels:

csharp
TabbedGroup tabbedgroup = new TabbedGroup();
DockLayoutManager1.DockController.Dock(tabbedgroup, rootgroup , DockType.Fill);
LayoutPanel toolspanel = DockLayoutManager1.DockController.AddPanel(DockType.None);
toolspanel.Caption = "Tools";
LayoutPanel errorspanel = DockLayoutManager1.DockController.AddPanel(DockType.None);
errorspanel.Caption = "Errors";
LayoutPanel outputpanel = DockLayoutManager1.DockController.AddPanel(DockType.None);
outputpanel.Caption = "Output";
tabbedgroup.Items.Add(toolspanel);
tabbedgroup.Items.Add(errorspanel);
tabbedgroup.Items.Add(outputpanel);
DockLayoutManager1.DockController.Dock(toolspanel, tabbedgroup, DockType.Fill);
DockLayoutManager1.DockController.Dock(errorspanel, tabbedgroup, DockType.Fill);
DockLayoutManager1.DockController.Dock(outputpanel, tabbedgroup, DockType.Fill);
vb
Dim tabbedgroup As TabbedGroup = New TabbedGroup()
DockLayoutManager1.DockController.Dock(tabbedgroup, rootgroup, DockType.Fill)
Dim toolspanel As LayoutPanel = DockLayoutManager1.DockController.AddPanel(DockType.None)
toolspanel.Caption = "Tools"
Dim errorspanel As LayoutPanel = DockLayoutManager1.DockController.AddPanel(DockType.None)
errorspanel.Caption = "Errors"
Dim outputpanel As LayoutPanel = DockLayoutManager1.DockController.AddPanel(DockType.None)
outputpanel.Caption = "Output"
tabbedgroup.Items.Add(toolspanel)
tabbedgroup.Items.Add(errorspanel)
tabbedgroup.Items.Add(outputpanel)
DockLayoutManager1.DockController.Dock(toolspanel, tabbedgroup, DockType.Fill)
DockLayoutManager1.DockController.Dock(errorspanel, tabbedgroup, DockType.Fill)
DockLayoutManager1.DockController.Dock(outputpanel, tabbedgroup, DockType.Fill)

The TabCaption property allows you to specify item caption displayed in the tab area.

Child Items

The TabbedGroup object can contain the LayoutPanel child object.

Note

Use the LayoutGroup.SelectedTabIndex property to display a specific tab.

Add Child Items In Code

Create a LayoutPanel object and use the Add method to add the LayoutPanel to the TabbedGroup ‘s Items collection.

csharp
LayoutPanel layoutpanel = DockLayoutManager1.DockController.AddPanel(DockType.None);
layoutpanel.Caption = "Tools";
tabbedgroup.Items.Add(layoutpanel);
DockLayoutManager1.DockController.Dock(layoutpanel, tabbedgroup, DockType.Fill);
vb
Dim layoutpanel As LayoutPanel = DockLayoutManager1.DockController.AddPanel(DockType.None)
layoutpanel.Caption = "Tools"
tabbedgroup.Items.Add(layoutpanel)
DockLayoutManager1.DockController.Dock(layoutpanel, tabbedgroup, DockType.Fill)

Customize TabbedGroups

Single Tab Header

Use the ShowTabForSinglePage property to specify whether the TabbedGroup should display a single child panel’s tab header.

Tab Header Style

Use the TabHeaderLayoutType property to specify a TabbedGroup ‘s header style.

Tab Content Cache

Use the TabContentCacheMode property to specify the TabbedGroup ‘s content cache mode.

Size

Use the ItemHeight and ItemWidth properties to specify the TabbedGroup ‘s height and width.

AutoScroll on Overflow

Use the AutoScrollOnOverflow property to specify how the TabbedGroup ‘s headers are scrolled when they cannot fit into the header panel area.

Operations with TabbedGroups

Use the following DockLayoutManager.DockController object’s methods to control a TabbedGroup :

MethodDescription
AddPanelCreates a LayoutPanel and docks it at the specified side of the DockLayoutManager container (root group). The method’s DockType parameter must be set to DockType.Fill to create a Tabbed Group.
Close(BaseLayoutItem)Closes the specified item.
CloseAllButThis(BaseLayoutItem)Closes all items except the specified one within this item’s container.
DockDocks the specified item. This method is in effect for newly created, floating, auto-hidden, or closed (hidden) items.
Float(BaseLayoutItem)Makes the specified item floating.
HideEnables the auto-hide mode for the item/panel and hides it at a corresponding edge of the DockLayoutManager container.
Insert(LayoutGroup, BaseLayoutItem, Int32)Inserts the specified item into the specified group at a specific position.
Rename(BaseLayoutItem)Starts dock item renaming.
Restore(BaseLayoutItem)Restores a closed (hidden) panel at its previous dock position.

Note

Set the BaseLayoutItem.AllowDock property to true to allow dock operations.

Events

You can use the following DockLayoutManager‘s events to control a dock element at runtime:

EventDescription
DockItemActivatedFires after a dock item has been activated.
DockItemActivatingFires before a dock item is activated, and allows you to prevent this action.
DockItemClosedFires after a dock item has been closed (hidden).
DockItemClosingFires before a dock item is closed (hidden), and allows you to prevent this action.
DockItemCollapsedFires after a visible auto-hidden dock panel has slid away.
DockItemDockingFires before a dock item is dragged over dock hints, and allows you to prevent dock zones from being displayed.
DockItemDraggingFires repeatedly while a dock panel is being dragged.
DockItemEndDockingFires after a dock item has been dropped, and allows you to prevent this action.
DockItemExpandedFires after a hidden auto-hidden dock panel has slid out.
DockItemHiddenFires after a dock item has been made auto-hidden.
DockItemHidingFires before a dock item is auto-hidden, and allows you to prevent this action.
DockItemRestoredFires after a dock item has been restored from the closed (hidden) state.
DockItemRestoringFires before a dock item is restored from the closed (hidden) state, and allows you to prevent this action.
DockItemStartDockingFires when a docking operation starts, and allows you to prevent this operation.

The following code snippets (auto-collected from DevExpress Examples) contain references to the TabbedGroup class.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

wpf-dock-layout-manager-define-prism-regions-for-dock-layout-manager-elements/CS/PrismOnDXDocking/Shell.xaml#L20

xml
</Style>
    <Style TargetType="dxdo:TabbedGroup" BasedOn="{StaticResource {x:Type dxdo:LayoutGroup}}"/>
</Window.Resources>

wpf-docklayoutmanager-use-layoutadapter-to-build-dock-ui-with-mvvm/CS/dxSampleGrid/MainWindow.xaml#L29

xml
<dxdo:LayoutGroup x:Name="LayoutGroup1">
    <dxdo:TabbedGroup x:Name="TabbedGroup1"/>
</dxdo:LayoutGroup>

wpf-docklayoutmanager-use-services-that-implement-the-idocumentmanagerservice/CS/DXDocumentUIServiceSample/MainWindow.xaml#L16

xml
<dxdo:LayoutGroup>
    <dxdo:TabbedGroup>
        <dxdo:LayoutPanel Caption="WindowedDocumentUIService">

Inheritance

Show 12 items

Object DispatcherObject DependencyObject Visual UIElement FrameworkElement Control DevExpress.Xpf.Docking.psvFrameworkElement BaseLayoutItem LayoutGroup TabbedGroup DocumentGroup

See Also

TabbedGroup Members

DevExpress.Xpf.Docking Namespace