wpf-devexpress-dot-xpf-dot-docking-9d1a5b75.md
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.v25.2.dll
NuGet Package : DevExpress.Wpf.Docking
public class DocumentGroup :
TabbedGroup
Public Class DocumentGroup
Inherits TabbedGroup
The following members return DocumentGroup objects:
View Example: Create a DocumentGroup with Two DocumentPanel Tabs
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>
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);
Dim documentgroup As DocumentGroup = New DocumentGroup()
DockLayoutManager1.DockController.Dock(documentgroup, rootgroup, DockType.Fill)
Dim document1 As DocumentPanel = DockLayoutManager1.DockController.AddDocumentPanel(documentgroup)
document1.Caption = "Document1"
Dim document2 As DocumentPanel = DockLayoutManager1.DockController.AddDocumentPanel(documentgroup)
document2.Caption = "Document2"
DockLayoutManager1.DockController.Dock(document2, documentgroup, DockType.Fill)
Note
You can use DocumentGroups only inside a DockLayoutManager control.
The DocumentGroup object can contain the following child objects:
Use the DocumentGroup.MDIStyle property to switch between the Tabbed and MDI styles.
DockLayoutManager - Tabbed MDIStyle
DockLayoutManager - MDI MDIStyle
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. |
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. |
| 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. |
Use the DockLayoutManager.DockingStyle property to switch between dock modes.
Default mode allows you to drag DocumentPanels from their parent DocumentGroups at runtime. End users can dock these panels as regular layout panels
VS2010 mode allows you to dock DocumentPanels only to DocumentGroups. End users can arrange DocumentGroups either vertically or horizontally.
You can undock a DocumentGroup ‘s child DocumentPanels from the parent group. The DockLayoutManager.FloatingDocumentContainer property specifies the undocked panel’s behavior.
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.
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).
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.
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.
wpf-scheduler-use-entity-framework-to-bind-to-data/CS/DXSample/MainWindow.xaml#L23
<dxdo:LayoutGroup>
<dxdo:DocumentGroup ShowTabForSinglePage="False">
<dxdo:DocumentPanel>
<dxdo:LayoutGroup Name="leftGroup" prism:RegionManager.RegionName="{x:Static Infrastructure:RegionNames.LeftRegion}" ItemWidth="0.2*" />
<dxdo:DocumentGroup Name="documentContainer" ItemWidth="0.6*" MDIStyle="MDI" prism:RegionManager.RegionName="{x:Static Infrastructure:RegionNames.MainRegion}" DestroyOnClosingChildren="False"/>
<dxdo:LayoutGroup Name="rightGroup" prism:RegionManager.RegionName="{x:Static Infrastructure:RegionNames.RightRegion}" ItemWidth="0.2*" />
<dxdo:LayoutGroup>
<dxdo:DocumentGroup x:Name="ChildDocumentGroup" MDIStyle="Tabbed" DestroyOnClosingChildren="False">
<dxdo:DocumentPanel x:Name="Document1" Caption="DocumentPanel1" MDISize="800,600">
wpf-dock-layout-manager-upgrade-layouts-between-versions/CS/MainWindow.xaml#L36
<dxdo:LayoutGroup x:Name="root" Orientation="Vertical">
<dxdo:DocumentGroup x:Name="documentGroup1">
<dxdo:DocumentPanel x:Name="documentPanel1" Caption="Panel 1">
wpf-docklayoutmanager-use-imvvmdockingproperties-to-build-dock-ui-with-mvvm/CS/MainWindow.xaml#L13
<dxdo:LayoutGroup Caption="LayoutRoot" >
<dxdo:DocumentGroup x:Name="DocumentsGroup"/>
<dxdo:LayoutGroup x:Name="DockPanels" Orientation="Vertical"/>
Show 12 items
Object DispatcherObject DependencyObject Visual UIElement FrameworkElement Control DevExpress.Xpf.Docking.psvFrameworkElement BaseLayoutItem LayoutGroup TabbedGroup DocumentGroup
See Also