Skip to main content

DocumentGroup Class

A container for DocumentPanel and LayoutPanel objects. The DocumentGroup displays child DocumentPanel‘s in tabbed or MDI UIs.

Namespace: DevExpress.Xpf.Docking

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

NuGet Package: DevExpress.Wpf.Docking

Declaration

public class DocumentGroup :
    TabbedGroup

Remarks

Create DocumentGroups

View Example: Create a DocumentGroup with Two DocumentPanel Tabs

In XAML

The following code sample creates a DocumentGroup that contains two DocumentPanels:

<Window ...
  xmlns:dxdo="http://schemas.devexpress.com/winfx/2008/xaml/docking">
  <dxdo:DockLayoutManager>
    <dxdo:LayoutGroup>
      <dxdo:DocumentGroup>
        <dxdo:DocumentPanel Caption="Document1"/>
        <dxdo:DocumentPanel Caption="Document2"/>
      </dxdo:DocumentGroup>
    </dxdo:LayoutGroup>
  </dxdo:DockLayoutManager>
</Window>

In Code

The following code sample creates the DocumentGroup with nested DocumentPanels:

<Window ...
  xmlns:dxdo="http://schemas.devexpress.com/winfx/2008/xaml/docking">
  <dxdo:DockLayoutManager x:Name="DockLayoutManager1">
    <dxdo:LayoutGroup x:Name="rootgroup">
  </dxdo:DockLayoutManager>
</Window>
DocumentGroup documentgroup = new DocumentGroup();
DockLayoutManager1.DockController.Dock(documentgroup, rootgroup, DockType.Fill);
DocumentPanel document1 = DockLayoutManager1.DockController.AddDocumentPanel(documentgroup);
document1.Caption = "Document1";
DocumentPanel document2 = DockLayoutManager1.DockController.AddDocumentPanel(documentgroup);
document2.Caption = "Document2";
DockLayoutManager1.DockController.Dock(document2, documentgroup, DockType.Fill);

Dock Layout Manager - Create DocumentGroup in Code

Note

You can use DocumentGroups only inside a DockLayoutManager control.

Child Items

The DocumentGroup object can contain the following child objects:

Customize a DocumentGroup and its Children

Styles

Use the DocumentGroup.MDIStyle property to switch between the Tabbed and MDI styles.

MDI Style

You can use the following properties to customize a DocumentGroup and its child elements when the MDI style is active (DocumentGroup.MDIStyle is MDIStyle.MDI).

Tip

In MDI Mode, you can move DocumentPanels within the boundaries of a parent group only. Use Float Groups to move panels within the boundaries of a window or a desktop.

Property Description
DocumentPanel.MDILocation and DocumentPanel.MDISize Specify a child panel’s location and size.
DockLayoutManager.MDIController object’s TileHorizontal and TileVertical methods Align child panels horizontally or vertically.
DockLayoutManager.MDIController object’s Maximize, Minimize, and Restore methods Control a child panel’s state.

Tabbed Style

You can use the following properties to customize a DocumentGroup and its child elements when the Tabbed style is active (DocumentGroup.MDIStyle is MDIStyle.Tabbed).

Property Description
DocumentGroup.TabbedGroupDisplayMode Specifies the DocumentGroup‘s display mode.
CaptionLocation Specifies the DocumentGroup‘s tab location.
DocumentGroup.ClosePageButtonShowMode Specifies the Close button location.
DocumentGroup.ShowDropDownButton Specifies whether the drop-down button is displayed.

TabbedGroupDisplayMode Values

Pinned Panels

DockLayoutManager - DocumentGroup - Pin Properties

Property Description
DocumentGroup.Pinned Specifies whether the DocumentPanel is pinned.
DocumentGroup.PinLocation Specifies the pinned tab’s location.
DocumentGroup.ShowPinButton Specifies whether the pin button is displayed.

Dock Modes

Use the DockLayoutManager.DockingStyle property to switch between dock modes.

Default Mode

Default mode allows you to drag DocumentPanels from their parent DocumentGroups at runtime. End users can dock these panels as regular layout panels

Dock Windows - Default Docking Mode

Visual Studio 2010 Mode

VS2010 mode allows you to dock DocumentPanels only to DocumentGroups. End users can arrange DocumentGroups either vertically or horizontally.

Dock Windows - VS2010 Docking Mode

Floating Containers

You can undock a DocumentGroup‘s child DocumentPanels from the parent group. The DockLayoutManager.FloatingDocumentContainer property specifies the undocked panel’s behavior.

Taskbar Thumbnails

If the DockLayoutManager.ShowFloatWindowsInTaskbar property is true, the floating DocumentPanel‘s individual taskbar thumbnails are not displayed. Instead, a single thumbnail for the entire container is displayed.

Operations with DocumentGroups

Methods

Use the DockLayoutManager.MDIController object’s methods to control a DocumentGroup and its DocumentPanels when the MDI style is active (DocumentGroup.MDIStyle is MDIStyle.MDI).

Events

You can use the following DockLayoutManager events to control a DocumentGroup and its DocumentPanels at runtime:

Event Description
DockLayoutManager.MDIItemActivated Fires when an MDI child document has been activated.
DockLayoutManager.MDIItemActivating Fires before an MDI child panel is activated.
DockLayoutManager.DockItemActivated Fires after a dock item has been activated.
DockLayoutManager.DockItemActivating Fires before a dock item is activated, and allows you to prevent this action.
DockLayoutManager.DockItemClosed Fires after a dock item has been closed (hidden).
DockLayoutManager.DockItemClosing Fires before a dock item is closed (hidden), and allows you to prevent this action.
DockLayoutManager.DockItemCollapsed Fires after a visible auto-hidden dock panel has slid away.
DockLayoutManager.DockItemDocking Fires before a dock item is dragged over dock hints, and allows you to prevent dock zones from being displayed.
DockLayoutManager.DockItemRestored Fires after a dock item has been restored from the closed (hidden) state.
DockLayoutManager.DockItemRestoring Fires before a dock item is restored from the closed (hidden) state, and allows you to prevent this action.
DockLayoutManager.DockItemStartDocking Fires when a docking operation starts, and allows you to prevent this operation.

The DockLayoutManager deletes the DocumentGroup if you remove all items from this group. To prevent this behavior, set the DocumentGroup‘s DestroyOnClosingChildren property to false.

End-User Interactions

An end user can switch between dock panels (including a DocumentGroup‘s child panels) with the Document Selector.

The following code snippets (auto-collected from DevExpress Examples) contain references to the DocumentGroup 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.

Inheritance

See Also