Back to Devexpress

DocumentGroup Class

wpf-devexpress-dot-xpf-dot-docking-9d1a5b75.md

latest16.7 KB
Original Source

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.v25.2.dll

NuGet Package : DevExpress.Wpf.Docking

Declaration

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

The following members return DocumentGroup objects:

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:

xaml
<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:

xaml
<Window ...
  xmlns:dxdo="http://schemas.devexpress.com/winfx/2008/xaml/docking">
  <dxdo:DockLayoutManager x:Name="DockLayoutManager1">
    <dxdo:LayoutGroup x:Name="rootgroup">
  </dxdo:DockLayoutManager>
</Window>
csharp
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);
vb
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.

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.

DockLayoutManager - Tabbed MDIStyle

DockLayoutManager - MDI MDIStyle

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.

PropertyDescription
DocumentPanel.MDILocation and DocumentPanel.MDISizeSpecify a child panel’s location and size.
DockLayoutManager.MDIController object’s TileHorizontal and TileVertical methodsAlign child panels horizontally or vertically.
DockLayoutManager.MDIController object’s Maximize, Minimize, and Restore methodsControl 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).

PropertyDescription
DocumentGroup.TabbedGroupDisplayModeSpecifies the DocumentGroup ‘s display mode.
CaptionLocationSpecifies the DocumentGroup ‘s tab location.
DocumentGroup.ClosePageButtonShowModeSpecifies the Close button location.
DocumentGroup.ShowDropDownButtonSpecifies whether the drop-down button is displayed.

Pinned Panels

PropertyDescription
DocumentGroup.PinnedSpecifies whether the DocumentPanel is pinned.
DocumentGroup.PinLocationSpecifies the pinned tab’s location.
DocumentGroup.ShowPinButtonSpecifies 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

Visual Studio 2010 Mode

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

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:

EventDescription
DockLayoutManager.MDIItemActivatedFires when an MDI child document has been activated.
DockLayoutManager.MDIItemActivatingFires before an MDI child panel is activated.
DockLayoutManager.DockItemActivatedFires after a dock item has been activated.
DockLayoutManager.DockItemActivatingFires before a dock item is activated, and allows you to prevent this action.
DockLayoutManager.DockItemClosedFires after a dock item has been closed (hidden).
DockLayoutManager.DockItemClosingFires before a dock item is closed (hidden), and allows you to prevent this action.
DockLayoutManager.DockItemCollapsedFires after a visible auto-hidden dock panel has slid away.
DockLayoutManager.DockItemDockingFires before a dock item is dragged over dock hints, and allows you to prevent dock zones from being displayed.
DockLayoutManager.DockItemRestoredFires after a dock item has been restored from the closed (hidden) state.
DockLayoutManager.DockItemRestoringFires before a dock item is restored from the closed (hidden) state, and allows you to prevent this action.
DockLayoutManager.DockItemStartDockingFires 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.

wpf-scheduler-use-entity-framework-to-bind-to-data/CS/DXSample/MainWindow.xaml#L23

xml
<dxdo:LayoutGroup>
    <dxdo:DocumentGroup ShowTabForSinglePage="False">
        <dxdo:DocumentPanel>

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

xml
<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*" />

wpf-docklayoutmanager-merge-bars-in-controls-that-support-automatic-merging/CS/WpfApplication1/MainWindow.xaml#L21

xml
<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

xml
<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

xml
<dxdo:LayoutGroup Caption="LayoutRoot" >
    <dxdo:DocumentGroup x:Name="DocumentsGroup"/>
    <dxdo:LayoutGroup x:Name="DockPanels" Orientation="Vertical"/>

Inheritance

Show 12 items

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

See Also

DocumentGroup Members

DevExpress.Xpf.Docking Namespace