# MDI Ribbon Merging | WPF Controls | DevExpress Documentation

Ribbon merging allows you to combine elements of two different ribbon controls or ribbon status bars. This makes sense in MDI-like applications, where both main and child windows have their own ribbon controls and ribbon status bars. Although WPF lacks native support for MDI creation, you can overcome this with the help of the DevExpress [DockLayoutManager](/WPF/DevExpress.Xpf.Docking.DockLayoutManager) component. This component provides the [DocumentGroup](/WPF/DevExpress.Xpf.Docking.DocumentGroup) and [DocumentPanel](/WPF/DevExpress.Xpf.Docking.DocumentPanel) containers that help you create native and tabbed MDI interfaces. The following animation illustrates how ribbon merging operates.

![DXRibbon merging GIF](/WPF/images/dxribbon-merging-gif15114.gif)

The merging process affects the following elements: [RibbonPageCategory](/WPF/DevExpress.Xpf.Ribbon.RibbonPageCategory) items, [RibbonPage](/WPF/DevExpress.Xpf.Ribbon.RibbonPage)s, [RibbonPageGroup](/WPF/DevExpress.Xpf.Ribbon.RibbonPageGroup)s and [BarItem](/WPF/DevExpress.Xpf.Bars.BarItem)s within page groups, quick access toolbars and ribbon status bar controls. These elements are being added from a child [RibbonControl](/WPF/DevExpress.Xpf.Ribbon.RibbonControl) ([RibbonStatusBarControl](/WPF/DevExpress.Xpf.Ribbon.RibbonStatusBarControl)) to the parent [RibbonControl](/WPF/DevExpress.Xpf.Ribbon.RibbonControl) ([RibbonStatusBarControl](/WPF/DevExpress.Xpf.Ribbon.RibbonStatusBarControl)).

## Merging Mechanism

By default, the merging mechanism is triggered:

- when a DocumentPanel is maximized in a regular MDI mode.
- when a tab (DocumentPanel) is activated in a tabbed MDI mode.

This default behavior can be changed via the [DockLayoutManager.MDIMergeStyle](/WPF/DevExpress.Xpf.Docking.DockLayoutManager.MDIMergeStyle) property that affects all child panels within a [DockLayoutManager](/WPF/DevExpress.Xpf.Docking.DockLayoutManager). Depending on this property value, you can either completely restrict ribbon merging, allow merging for activated tabs and maximized MDI panels only, or specify all currently activated tabs and maximized MDI panels should be merged at the same time. To specify merging behavior for individual panels, use the [DocumentPanel.MDIMergeStyle](/WPF/DevExpress.Xpf.Docking.LayoutPanel.MDIMergeStyle) attached property instead. This property has a higher priority than the [DockLayoutManager.MDIMergeStyle](/WPF/DevExpress.Xpf.Docking.DockLayoutManager.MDIMergeStyle) property.

It is also possible to prevent the RibbonControl/RibbonStatusBar from being merged by setting the [RibbonControl.MDIMergeStyle](/WPF/DevExpress.Xpf.Ribbon.RibbonControl.MDIMergeStyle)/[RibbonStatusBarControl.MDIMergeStyle](/WPF/DevExpress.Xpf.Ribbon.RibbonStatusBarControl.MDIMergeStyle) property to [MDIMergeStyle.Never](/WPF/DevExpress.Xpf.Bars.MDIMergeStyle).

Every element that is being merged has the **MergeType** property, which regulates precisely how parent and child ribbon elements merge. For instance, using the **MergeType** property, you can specify that parent and child ribbon elements with the same caption should be combined into a single element. You can also specify that child ribbon elements should be added to the parent ribbon or hidden after merging. See the [RibbonMergeType](/WPF/DevExpress.Xpf.Ribbon.RibbonMergeType) topic for information on available merging options. To change merge types for ribbon elements, use the [RibbonPageCategoryBase.MergeType](/WPF/DevExpress.Xpf.Ribbon.RibbonPageCategoryBase.MergeType), [RibbonPage.MergeType](/WPF/DevExpress.Xpf.Ribbon.RibbonPage.MergeType), [RibbonPageGroup.MergeType](/WPF/DevExpress.Xpf.Ribbon.RibbonPageGroup.MergeType) and [BarItemLinkBase.MergeType](/WPF/DevExpress.Xpf.Bars.BarItemLinkBase.MergeType) properties.

By default, merged elements are arranged in the following order: first are the parent object elements and then child object elements. You can re-arrange elements during a merge using the **MergeOrder** property (see the [RibbonPageCategoryBase.MergeOrder](/WPF/DevExpress.Xpf.Ribbon.RibbonPageCategoryBase.MergeOrder), [RibbonPage.MergeOrder](/WPF/DevExpress.Xpf.Ribbon.RibbonPage.MergeOrder), [RibbonPageGroup.MergeOrder](/WPF/DevExpress.Xpf.Ribbon.RibbonPageGroup.MergeOrder) and [BarItemLinkBase.MergeOrder](/WPF/DevExpress.Xpf.Bars.BarItemLinkBase.MergeOrder) topics to learn more). The first element has a **MergeOrder** of 0. An element with the greatest **MergeOrder** value is the last. The default **MergeOrder** value for all elements is 0.

Consider the following Ribbon Controls:

- XAML

<section id="tabpanel_vm0NEgTZce_tabid-xaml" role="tabpanel" data-tab="tabid-xaml">
<pre><code class="lang-xaml">The parent Ribbon Control:
&lt;dxr:RibbonPage MergeOrder=&quot;0&quot; Caption=&quot;Home&quot; Name=&quot;mainHomePage&quot;&gt; ... &lt;/dxr:RibbonPage&gt;
&lt;dxr:RibbonPage MergeOrder=&quot;2&quot; Caption=&quot;View&quot; Name=&quot;mainViewPage&quot;&gt; ... &lt;/dxr:RibbonPage&gt;

The child Ribbon Control:
&lt;dxr:RibbonPage MergeOrder=&quot;1&quot; Caption=&quot;Insert&quot; Name=&quot;child2InsertPage&quot;&gt; ... &lt;/dxr:RibbonPage&gt;
&lt;dxr:RibbonPage MergeOrder=&quot;4&quot; Caption=&quot;Add-ins&quot; Name=&quot;child2AddInsPage&quot;&gt; ... &lt;/dxr:RibbonPage&gt;
&lt;dxr:RibbonPage MergeOrder=&quot;3&quot; Caption=&quot;Test&quot; Name=&quot;child2TestPage&quot;&gt; ... &lt;/dxr:RibbonPage&gt;
</code></pre></section>

Merging these Ribbon Controls will result in the page arrangement shown below.

![DXRibbon merge order example image](/WPF/images/dxribbon-merge-order-example-image15105.png)

After elements are merged by the **MergeType** and **MergeOrder** properties, the merging process repeats the described actions for merging sub-items. This means page categories are merged and arranged first. Then come ribbon pages, ribbon page groups and last - group items (commands). All these sub-elements have their own independent **MergeType** and **MergeOrder** properties, just like their holders.

## Unmerging Mechanism

The merging operation is not irreversible. Unmerging is performed via the [RibbonControl.UnMerge](/WPF/DevExpress.Xpf.Ribbon.RibbonControl.UnMerge.overloads) and [RibbonStatusBarControl.UnMerge](/WPF/DevExpress.Xpf.Ribbon.RibbonStatusBarControl.UnMerge.overloads) methods. If you have merged multiple Ribbon objects, you can either define which child Ribbon object should be umerged from the parent object or completely restore the parent control’s layout. In the latter case, use the required **Unmerge** method with no parameters.

The most common way to perform an unmerging operation is to handle the [DockLayoutManager.UnMerge](/WPF/DevExpress.Xpf.Docking.DockLayoutManager.UnMerge) event, which is the reverse of the [DockLayoutManager.Merge](/WPF/DevExpress.Xpf.Docking.DockLayoutManager.Merge) event. So, in order to unmerge parent and child ribbon objects, use the same code as in the ‘Merging Mechanism’ section and replace **Merge** methods with the corresponding **Unmerge** methods.

## Example

[View Example](https://github.com/DevExpress-Examples/wpf-docklayoutmanager-merge-ribbon-controls)

- MainWindow.xaml.cs
- MainWindow.xaml
- MainWindow.xaml.vb

<section id="tabpanel_dxe-Imodev_tabid-csharpMainWindow-xaml-cs" role="tabpanel" data-tab="tabid-csharpMainWindow-xaml-cs">
<pre><code data-code-links="{&quot;/ (DevExpress.Xpf.Docking)(?:;|$)/&quot;:&quot;/WPF/DevExpress.Xpf.Docking&quot;,&quot;/ (DevExpress.Xpf.Layout.Core)(?:;|$)/&quot;:&quot;/WPF/DevExpress.Xpf.Layout.Core&quot;,&quot;/ (DevExpress.Xpf.Ribbon)(?:;|$)/&quot;:&quot;/WPF/DevExpress.Xpf.Ribbon&quot;,&quot;/ (System)(?:;|$)/&quot;:&quot;https://learn.microsoft.com/dotnet/api/system&quot;,&quot;/ (System.Collections.Generic)(?:;|$)/&quot;:&quot;https://learn.microsoft.com/dotnet/api/system.collections.generic&quot;,&quot;/ (System.Linq)(?:;|$)/&quot;:&quot;https://learn.microsoft.com/dotnet/api/system.linq&quot;,&quot;/ (System.Text)(?:;|$)/&quot;:&quot;https://learn.microsoft.com/dotnet/api/system.text&quot;,&quot;/ (System.Threading.Tasks)(?:;|$)/&quot;:&quot;https://learn.microsoft.com/dotnet/api/system.threading.tasks&quot;,&quot;/ (System.Windows)(?:;|$)/&quot;:&quot;https://learn.microsoft.com/dotnet/api/system.windows&quot;,&quot;/ (System.Windows.Controls)(?:;|$)/&quot;:&quot;https://learn.microsoft.com/dotnet/api/system.windows.controls&quot;,&quot;/ (System.Windows.Data)(?:;|$)/&quot;:&quot;https://learn.microsoft.com/dotnet/api/system.windows.data&quot;,&quot;/ (System.Windows.Documents)(?:;|$)/&quot;:&quot;https://learn.microsoft.com/dotnet/api/system.windows.documents&quot;,&quot;/ (System.Windows.Input)(?:;|$)/&quot;:&quot;https://learn.microsoft.com/dotnet/api/system.windows.input&quot;,&quot;/ (System.Windows.Media)(?:;|$)/&quot;:&quot;https://learn.microsoft.com/dotnet/api/system.windows.media&quot;,&quot;/ (System.Windows.Media.Imaging)(?:;|$)/&quot;:&quot;https://learn.microsoft.com/dotnet/api/system.windows.media.imaging&quot;,&quot;/ (System.Windows.Navigation)(?:;|$)/&quot;:&quot;https://learn.microsoft.com/dotnet/api/system.windows.navigation&quot;,&quot;/ (System.Windows.Shapes)(?:;|$)/&quot;:&quot;https://learn.microsoft.com/dotnet/api/system.windows.shapes&quot;}" class="lang-csharp">using DevExpress.Xpf.Docking;
using DevExpress.Xpf.Layout.Core;
using DevExpress.Xpf.Ribbon;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace WpfApplication1
{
    /// &lt;summary&gt;
    /// Interaction logic for MainWindow.xaml
    /// &lt;/summary&gt;
    public partial class MainWindow : DXRibbonWindow
    {
        public MainWindow()
        {
            InitializeComponent();
        }

        private void biMDI_ItemClick(object sender, DevExpress.Xpf.Bars.ItemClickEventArgs e)
        {
            ChildDocumentGroup.MDIStyle = MDIStyle.MDI;
        }

        private void biTabbed_ItemClick(object sender, DevExpress.Xpf.Bars.ItemClickEventArgs e)
        {
            ChildDocumentGroup.MDIStyle = MDIStyle.Tabbed;
        }
    }
}
</code></pre></section>
<section id="tabpanel_dxe-Imodev_tabid-xamlMainWindow-xaml" role="tabpanel" data-tab="tabid-xamlMainWindow-xaml" aria-hidden="true" hidden="hidden">
<pre><code class="lang-xaml">&lt;dxr:DXRibbonWindow
        xmlns=&quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&quot;
        xmlns:x=&quot;http://schemas.microsoft.com/winfx/2006/xaml&quot;
        xmlns:dxdo=&quot;http://schemas.devexpress.com/winfx/2008/xaml/docking&quot; xmlns:dxr=&quot;http://schemas.devexpress.com/winfx/2008/xaml/ribbon&quot; xmlns:dx=&quot;http://schemas.devexpress.com/winfx/2008/xaml/core&quot; xmlns:dxb=&quot;http://schemas.devexpress.com/winfx/2008/xaml/bars&quot; x:Class=&quot;WpfApplication1.MainWindow&quot;
        Title=&quot;MainWindow&quot; Height=&quot;768&quot; Width=&quot;1024&quot;  dx:ThemeManager.ThemeName=&quot;Office2013LightGray&quot;&gt;
    &lt;Grid&gt;
        &lt;DockPanel&gt;
            &lt;dxr:RibbonControl x:Name=&quot;ParentRibbonControl&quot; DockPanel.Dock=&quot;Top&quot; Height=&quot;auto&quot; MDIMergeStyle=&quot;Always&quot; SelectedPageOnMerging=&quot;ParentSelectedPage&quot;&gt;
                &lt;dxr:RibbonDefaultPageCategory&gt;
                    &lt;dxr:RibbonPage Caption=&quot;Home&quot;&gt;
                        &lt;dxr:RibbonPageGroup Caption=&quot;File&quot;&gt;
                            &lt;dxb:BarButtonItem x:Name=&quot;biNew&quot; Content=&quot;New&quot; LargeGlyph=&quot;{dx:DXImage Image=New_32x32.png}&quot;/&gt;
                            &lt;dxb:BarButtonItem x:Name=&quot;biOpen&quot; Content=&quot;Open&quot; Glyph=&quot;{dx:DXImage Image=Open_16x16.png}&quot;/&gt;
                            &lt;dxb:BarButtonItem x:Name=&quot;biSave&quot; Content=&quot;Save&quot; Glyph=&quot;{dx:DXImage Image=Save_16x16.png}&quot;/&gt;
                            &lt;dxb:BarButtonItem x:Name=&quot;biSaveAs&quot; Content=&quot;Save As&quot; Glyph=&quot;{dx:DXImage Image=SaveAs_16x16.png}&quot;/&gt;
                        &lt;/dxr:RibbonPageGroup&gt;
                        &lt;dxr:RibbonPageGroup Caption=&quot;MDIStyle&quot;&gt;
                            &lt;dxb:BarButtonItem x:Name=&quot;biMDI&quot; Content=&quot;MDI&quot; Glyph=&quot;{dx:DXImage Image=Employee_16x16.png}&quot; ItemClick=&quot;biMDI_ItemClick&quot;/&gt;
                            &lt;dxb:BarButtonItem x:Name=&quot;biTabbed&quot; Content=&quot;Tabbed&quot; Glyph=&quot;{dx:DXImage Image=Employee_16x16.png}&quot; ItemClick=&quot;biTabbed_ItemClick&quot; /&gt;
                        &lt;/dxr:RibbonPageGroup&gt;
                    &lt;/dxr:RibbonPage&gt;
                &lt;/dxr:RibbonDefaultPageCategory&gt;
            &lt;/dxr:RibbonControl&gt;
            &lt;dxr:RibbonStatusBarControl DockPanel.Dock=&quot;Bottom&quot; MDIMergeStyle=&quot;Always&quot;&gt;
                &lt;dxr:RibbonStatusBarControl.LeftItems&gt;
                    &lt;dxb:BarStaticItem x:Name=&quot;biRow&quot; Content=&quot;Row:&quot; ShowBorder=&quot;False&quot; MergeType=&quot;MergeItems&quot;/&gt;
                    &lt;dxb:BarStaticItem x:Name=&quot;biRowValue&quot; Content=&quot;1&quot; MergeType=&quot;MergeItems&quot;/&gt;
                    &lt;dxb:BarStaticItem x:Name=&quot;biColumn&quot; Content=&quot;Column:&quot; ShowBorder=&quot;False&quot; MergeType=&quot;MergeItems&quot;/&gt;
                    &lt;dxb:BarStaticItem x:Name=&quot;biColumnValue&quot; Content=&quot;1&quot; MergeType=&quot;MergeItems&quot;/&gt;
                &lt;/dxr:RibbonStatusBarControl.LeftItems&gt;
                &lt;dxr:RibbonStatusBarControl.RightItems&gt;
                    &lt;dxb:BarCheckItem x:Name=&quot;biLeft&quot; Glyph=&quot;{dx:DXImage Image=AlignLeft_16x16.png}&quot; GroupIndex=&quot;1&quot; IsChecked=&quot;True&quot; MergeType=&quot;MergeItems&quot;/&gt;
                    &lt;dxb:BarCheckItem x:Name=&quot;biCenter&quot; Glyph=&quot;{dx:DXImage Image=AlignCenter_16x16.png}&quot; GroupIndex=&quot;1&quot; MergeType=&quot;MergeItems&quot;/&gt;
                    &lt;dxb:BarCheckItem x:Name=&quot;biRight&quot; Glyph=&quot;{dx:DXImage Image=AlignRight_16x16.png}&quot; GroupIndex=&quot;1&quot; MergeType=&quot;MergeItems&quot;/&gt;
                &lt;/dxr:RibbonStatusBarControl.RightItems&gt;
            &lt;/dxr:RibbonStatusBarControl&gt;
            &lt;Grid&gt;
                &lt;dxdo:DockLayoutManager x:Name=&quot;dlManager&quot;&gt;
                    &lt;dxdo:LayoutGroup&gt;
                        &lt;dxdo:DocumentGroup x:Name=&quot;ChildDocumentGroup&quot; MDIStyle=&quot;Tabbed&quot; DestroyOnClosingChildren=&quot;False&quot;&gt;
                            &lt;dxdo:DocumentPanel x:Name=&quot;Document1&quot; Caption=&quot;Document1&quot; MDISize=&quot;800,600&quot;&gt;
                                &lt;Grid&gt;
                                    &lt;DockPanel&gt;
                                        &lt;dxr:RibbonControl x:Name=&quot;ChildRibbonControl1&quot; DockPanel.Dock=&quot;Top&quot; Height=&quot;auto&quot; SelectedPageOnMerging=&quot;ParentSelectedPage&quot;&gt;
                                            &lt;dxr:RibbonDefaultPageCategory&gt;
                                                &lt;dxr:RibbonPage Caption=&quot;Home&quot; MergeType=&quot;MergeItems&quot;&gt;
                                                    &lt;dxr:RibbonPageGroup Caption=&quot;Clipboard&quot;&gt;
                                                        &lt;dxb:BarButtonItem x:Name=&quot;biPaste&quot; Content=&quot;Paste&quot; Glyph=&quot;{dx:DXImage Image=Paste_16x16.png}&quot; 
                                                                                               LargeGlyph=&quot;{dx:DXImage Image=Paste_32x32.png}&quot;/&gt;
                                                        &lt;dxb:BarButtonItem x:Name=&quot;biCut&quot; Content=&quot;Cut&quot; Glyph=&quot;{dx:DXImage Image=Cut_16x16.png}&quot;/&gt;
                                                        &lt;dxb:BarButtonItem x:Name=&quot;biCopy&quot; Content=&quot;Copy&quot; Glyph=&quot;{dx:DXImage Image=Copy_16x16.png}&quot;/&gt;
                                                    &lt;/dxr:RibbonPageGroup&gt;
                                                    &lt;dxr:RibbonPageGroup Caption=&quot;Font&quot;&gt;
                                                        &lt;dxb:BarButtonItem x:Name=&quot;biBold&quot; Content=&quot;Bold&quot; LargeGlyph=&quot;{dx:DXImage Image=Bold_32x32.png}&quot;/&gt;
                                                        &lt;dxb:BarButtonItem x:Name=&quot;biItalic&quot; Content=&quot;Italic&quot; LargeGlyph=&quot;{dx:DXImage Image=Italic_32x32.png}&quot;/&gt;
                                                        &lt;dxb:BarButtonItem x:Name=&quot;biUnderline&quot; Content=&quot;Underline&quot; LargeGlyph=&quot;{dx:DXImage Image=Underline_32x32.png}&quot;/&gt;
                                                    &lt;/dxr:RibbonPageGroup&gt;

                                                &lt;/dxr:RibbonPage&gt;
                                                &lt;dxr:RibbonPage Caption=&quot;View&quot; MergeType=&quot;MergeItems&quot;&gt;
                                                    &lt;dxr:RibbonPageGroup Caption=&quot;Zoom&quot;&gt;
                                                        &lt;dxb:BarButtonItem x:Name=&quot;biZoom1&quot; Content=&quot;Zoom&quot; LargeGlyph=&quot;{dx:DXImage Image=Zoom_32x32.png}&quot; Glyph=&quot;{dx:DXImage Image=Zoom_16x16.png}&quot;/&gt;
                                                        &lt;dxb:BarButtonItem x:Name=&quot;bi100per1&quot; Content=&quot;100%&quot; Glyph=&quot;{dx:DXImage Image=Zoom100_16x16.png}&quot;/&gt;
                                                        &lt;dxb:BarButtonItem x:Name=&quot;biZoomIn1&quot; Content=&quot;Zoom In&quot; Glyph=&quot;{dx:DXImage Image=ZoomIn_16x16.png}&quot;/&gt;
                                                        &lt;dxb:BarButtonItem x:Name=&quot;biZoomOut1&quot; Content=&quot;Zoom Out&quot; Glyph=&quot;{dx:DXImage Image=ZoomOut_16x16.png}&quot;/&gt;
                                                    &lt;/dxr:RibbonPageGroup&gt;
                                                    &lt;dxr:RibbonPageGroup Caption=&quot;Print&quot;&gt;
                                                        &lt;dxb:BarButtonItem x:Name=&quot;biPrint1&quot; Content=&quot;Print&quot; LargeGlyph=&quot;{dx:DXImage Image=Print_32x32.png}&quot;/&gt;
                                                    &lt;/dxr:RibbonPageGroup&gt;
                                                &lt;/dxr:RibbonPage&gt;
                                                &lt;dxr:RibbonPage Caption=&quot;Paragraph&quot;&gt;
                                                    &lt;dxr:RibbonPageGroup Caption=&quot;Alighting Text&quot;&gt;
                                                        &lt;dxb:BarButtonItem x:Name=&quot;biCenter1&quot; Content=&quot;Center&quot; 
                                                                                               LargeGlyph=&quot;{dx:DXImage Image=AlignCenter_32x32.png}&quot; Glyph=&quot;{dx:DXImage Image=AlignCenter_16x16.png}&quot;/&gt;
                                                        &lt;dxb:BarButtonItem x:Name=&quot;biLeft1&quot; Content=&quot;Left&quot; 
                                                                                               Glyph=&quot;{dx:DXImage Image=AlignLeft_16x16.png}&quot;/&gt;
                                                        &lt;dxb:BarButtonItem x:Name=&quot;biRight1&quot; Content=&quot;Right&quot; 
                                                                                               Glyph=&quot;{dx:DXImage Image=AlignRight_16x16.png}&quot;/&gt;
                                                        &lt;dxb:BarButtonItem x:Name=&quot;biJustify&quot; Content=&quot;Justify&quot; Glyph=&quot;{dx:DXImage Image=AlignJustify_16x16.png}&quot;/&gt;
                                                    &lt;/dxr:RibbonPageGroup&gt;
                                                    &lt;dxr:RibbonPageGroup Caption=&quot;Lists&quot;&gt;
                                                        &lt;dxb:BarButtonItem x:Name=&quot;biBullets&quot; Content=&quot;Bullets&quot; Glyph=&quot;{dx:DXImage Image=ListBullets_16x16.png}&quot;/&gt;
                                                        &lt;dxb:BarButtonItem x:Name=&quot;biNumbers&quot; Content=&quot;Numbering&quot; Glyph=&quot;{dx:DXImage Image=ListNumbers_16x16.png}&quot;/&gt;
                                                        &lt;dxb:BarButtonItem x:Name=&quot;biMultilevel&quot; Content=&quot;Multelevel&quot; Glyph=&quot;{dx:DXImage Image=ListMultilevel_16x16.png}&quot;/&gt;
                                                    &lt;/dxr:RibbonPageGroup&gt;
                                                &lt;/dxr:RibbonPage&gt;
                                            &lt;/dxr:RibbonDefaultPageCategory&gt;
                                        &lt;/dxr:RibbonControl&gt;
                                        &lt;Grid/&gt;
                                    &lt;/DockPanel&gt;
                                &lt;/Grid&gt;
                            &lt;/dxdo:DocumentPanel&gt;
                            &lt;dxdo:DocumentPanel x:Name=&quot;Document2&quot; Caption=&quot;Document2&quot; MDILocation=&quot;226,22&quot; MDISize=&quot;800,600&quot;&gt;
                                &lt;Grid&gt;
                                    &lt;DockPanel&gt;
                                        &lt;dxr:RibbonControl x:Name=&quot;ChildRibbonControl2&quot; DockPanel.Dock=&quot;Top&quot; Height=&quot;auto&quot; SelectedPageOnMerging=&quot;ParentSelectedPage&quot;&gt;
                                            &lt;dxr:RibbonDefaultPageCategory&gt;
                                                &lt;dxr:RibbonPage Caption=&quot;View&quot; MergeType=&quot;MergeItems&quot;&gt;
                                                    &lt;dxr:RibbonPageGroup Caption=&quot;Zoom&quot;&gt;
                                                        &lt;dxb:BarButtonItem x:Name=&quot;biZoom&quot; Content=&quot;Zoom&quot; LargeGlyph=&quot;{dx:DXImage Image=Zoom_32x32.png}&quot; Glyph=&quot;{dx:DXImage Image=Zoom_16x16.png}&quot;/&gt;
                                                        &lt;dxb:BarButtonItem x:Name=&quot;bi100per&quot; Content=&quot;100%&quot; Glyph=&quot;{dx:DXImage Image=Zoom100_16x16.png}&quot;/&gt;
                                                        &lt;dxb:BarButtonItem x:Name=&quot;biZoomIn&quot; Content=&quot;Zoom In&quot; Glyph=&quot;{dx:DXImage Image=ZoomIn_16x16.png}&quot;/&gt;
                                                        &lt;dxb:BarButtonItem x:Name=&quot;biZoomOut&quot; Content=&quot;Zoom Out&quot; Glyph=&quot;{dx:DXImage Image=ZoomOut_16x16.png}&quot;/&gt;
                                                    &lt;/dxr:RibbonPageGroup&gt;
                                                    &lt;dxr:RibbonPageGroup Caption=&quot;Print&quot;&gt;
                                                        &lt;dxb:BarButtonItem x:Name=&quot;biPrint&quot; Content=&quot;Print&quot; LargeGlyph=&quot;{dx:DXImage Image=Print_32x32.png}&quot;/&gt;
                                                    &lt;/dxr:RibbonPageGroup&gt;
                                                &lt;/dxr:RibbonPage&gt;
                                                &lt;dxr:RibbonPage Caption=&quot;Options&quot;&gt;
                                                    &lt;dxr:RibbonPageGroup x:Name=&quot;Options&quot; Caption=&quot;Options&quot;&gt;
                                                        &lt;dxb:BarButtonItem x:Name=&quot;biHelp&quot; Content=&quot;Help&quot; Glyph=&quot;{dx:DXImage Image=Index_16x16.png}&quot; LargeGlyph=&quot;{dx:DXImage Image=Index_32x32.png}&quot; /&gt;
                                                        &lt;dxb:BarButtonItem x:Name=&quot;biFind&quot; Content=&quot;Find&quot; Glyph=&quot;{dx:DXImage Image=Find_32x32.png}&quot; LargeGlyph=&quot;{dx:DXImage Image=Find_32x32.png}&quot; /&gt;
                                                        &lt;dxb:BarButtonItem x:Name=&quot;biClose&quot; Content=&quot;Close&quot; Glyph=&quot;{dx:DXImage Image=Close_16x16.png}&quot; LargeGlyph=&quot;{dx:DXImage Image=Close_32x32.png}&quot;/&gt;
                                                    &lt;/dxr:RibbonPageGroup&gt;
                                                    &lt;dxr:RibbonPageGroup Caption=&quot;Comments&quot;&gt;
                                                        &lt;dxb:BarButtonItem x:Name=&quot;biNewComment&quot; Content=&quot;New Comment&quot; Glyph=&quot;{dx:DXImage Image=EditComment_16x16.png}&quot; LargeGlyph=&quot;{dx:DXImage Image=EditComment_32x32.png}&quot;/&gt;
                                                        &lt;dxb:BarButtonItem x:Name=&quot;biDelComment&quot; Content=&quot;Delete Comment&quot; Glyph=&quot;{dx:DXImage Image=DeleteComment_16x16.png}&quot; LargeGlyph=&quot;{dx:DXImage Image=DeleteComment_32x32.png}&quot; /&gt;
                                                        &lt;dxb:BarButtonItem x:Name=&quot;biNextComment&quot; Content=&quot;Next Comment&quot; Glyph=&quot;{dx:DXImage Image=NextComment_16x16.png}&quot; LargeGlyph=&quot;{dx:DXImage Image=NextComment_32x32.png}&quot;/&gt;
                                                        &lt;dxb:BarButtonItem x:Name=&quot;biPrevComment&quot; Content=&quot;Previous Comment&quot; Glyph=&quot;{dx:DXImage Image=PreviousComment_16x16.png}&quot; LargeGlyph=&quot;{dx:DXImage Image=PreviousComment_32x32.png}&quot;/&gt;
                                                    &lt;/dxr:RibbonPageGroup&gt;

                                                &lt;/dxr:RibbonPage&gt;
                                            &lt;/dxr:RibbonDefaultPageCategory&gt;
                                        &lt;/dxr:RibbonControl&gt;
                                        &lt;Grid/&gt;
                                    &lt;/DockPanel&gt;
                                &lt;/Grid&gt;
                            &lt;/dxdo:DocumentPanel&gt;
                        &lt;/dxdo:DocumentGroup&gt;
                    &lt;/dxdo:LayoutGroup&gt;
                &lt;/dxdo:DockLayoutManager&gt;
            &lt;/Grid&gt;
        &lt;/DockPanel&gt;
    &lt;/Grid&gt;
&lt;/dxr:DXRibbonWindow&gt;
</code></pre></section>
<section id="tabpanel_dxe-Imodev_tabid-vbMainWindow-xaml-vb" role="tabpanel" data-tab="tabid-vbMainWindow-xaml-vb" aria-hidden="true" hidden="hidden">
<pre><code data-code-links="{&quot;/ (DevExpress.Xpf.Docking)(?:;|$)/&quot;:&quot;/WPF/DevExpress.Xpf.Docking&quot;,&quot;/ (DevExpress.Xpf.Layout.Core)(?:;|$)/&quot;:&quot;/WPF/DevExpress.Xpf.Layout.Core&quot;,&quot;/ (DevExpress.Xpf.Ribbon)(?:;|$)/&quot;:&quot;/WPF/DevExpress.Xpf.Ribbon&quot;,&quot;/ (System)(?:;|$)/&quot;:&quot;https://learn.microsoft.com/dotnet/api/system&quot;,&quot;/ (System.Collections.Generic)(?:;|$)/&quot;:&quot;https://learn.microsoft.com/dotnet/api/system.collections.generic&quot;,&quot;/ (System.Linq)(?:;|$)/&quot;:&quot;https://learn.microsoft.com/dotnet/api/system.linq&quot;,&quot;/ (System.Text)(?:;|$)/&quot;:&quot;https://learn.microsoft.com/dotnet/api/system.text&quot;,&quot;/ (System.Threading.Tasks)(?:;|$)/&quot;:&quot;https://learn.microsoft.com/dotnet/api/system.threading.tasks&quot;,&quot;/ (System.Windows)(?:;|$)/&quot;:&quot;https://learn.microsoft.com/dotnet/api/system.windows&quot;,&quot;/ (System.Windows.Controls)(?:;|$)/&quot;:&quot;https://learn.microsoft.com/dotnet/api/system.windows.controls&quot;,&quot;/ (System.Windows.Data)(?:;|$)/&quot;:&quot;https://learn.microsoft.com/dotnet/api/system.windows.data&quot;,&quot;/ (System.Windows.Documents)(?:;|$)/&quot;:&quot;https://learn.microsoft.com/dotnet/api/system.windows.documents&quot;,&quot;/ (System.Windows.Input)(?:;|$)/&quot;:&quot;https://learn.microsoft.com/dotnet/api/system.windows.input&quot;,&quot;/ (System.Windows.Media)(?:;|$)/&quot;:&quot;https://learn.microsoft.com/dotnet/api/system.windows.media&quot;,&quot;/ (System.Windows.Media.Imaging)(?:;|$)/&quot;:&quot;https://learn.microsoft.com/dotnet/api/system.windows.media.imaging&quot;,&quot;/ (System.Windows.Navigation)(?:;|$)/&quot;:&quot;https://learn.microsoft.com/dotnet/api/system.windows.navigation&quot;,&quot;/ (System.Windows.Shapes)(?:;|$)/&quot;:&quot;https://learn.microsoft.com/dotnet/api/system.windows.shapes&quot;}" class="lang-vb">Imports DevExpress.Xpf.Docking
Imports DevExpress.Xpf.Layout.Core
Imports DevExpress.Xpf.Ribbon
Imports System
Imports System.Collections.Generic
Imports System.Linq
Imports System.Text
Imports System.Threading.Tasks
Imports System.Windows
Imports System.Windows.Controls
Imports System.Windows.Data
Imports System.Windows.Documents
Imports System.Windows.Input
Imports System.Windows.Media
Imports System.Windows.Media.Imaging
Imports System.Windows.Navigation
Imports System.Windows.Shapes

Namespace WpfApplication1
    &#39;&#39;&#39; &lt;summary&gt;
    &#39;&#39;&#39; Interaction logic for MainWindow.xaml
    &#39;&#39;&#39; &lt;/summary&gt;
    Partial Public Class MainWindow
        Inherits DXRibbonWindow

        Public Sub New()
            InitializeComponent()
        End Sub

        Private Sub biMDI_ItemClick(ByVal sender As Object, ByVal e As DevExpress.Xpf.Bars.ItemClickEventArgs)
            ChildDocumentGroup.MDIStyle = MDIStyle.MDI
        End Sub

        Private Sub biTabbed_ItemClick(ByVal sender As Object, ByVal e As DevExpress.Xpf.Bars.ItemClickEventArgs)
            ChildDocumentGroup.MDIStyle = MDIStyle.Tabbed
        End Sub
    End Class
End Namespace
</code></pre></section>

See Also

[Merge Bars and Ribbons in MDI Mode](/WPF/9155/controls-and-libraries/layout-management/dock-windows/mdi-bar-merging)