Skip to main content

RibbonPageGroup.MergeType Property

Gets or sets the way ribbon page groups merge. This is a dependency property.

Namespace: DevExpress.Xpf.Ribbon

Assembly: DevExpress.Xpf.Ribbon.v24.1.dll

NuGet Package: DevExpress.Wpf.Ribbon

Declaration

public RibbonMergeType MergeType { get; set; }

Property Value

Type Description
RibbonMergeType

A RibbonMergeType value indicating how ribbon page groups merge.

Available values:

Name Description
Add

Adds a child ribbon element to a parent ribbon even if an element with the same caption already exists in the parent ribbon.

Replace

Replaces a parent ribbon element with the current child ribbon element if they have the same caption.

If a parent element with the same caption is not found, the current child ribbon element is added to the parent ribbon.

MergeItems

The default merging mechanism. Sub-items of the current child ribbon element are merged into the parent ribbon element that has the same caption. If no parent element with the same caption exists, the current child ribbon element is appended according to its MergeOrder.

Remove

Prevents the current child ribbon element from being merged with a parent ribbon object.

If the MergeType for a parent element is set to Remove, this element is hidden after the merge is complete.

Remarks

You can adjust the way page groups of two ribbon controls merge using the MergeType property. Refer to the RibbonMergeType link for information on parameters.

See the MDI Ribbon Merging article for detailed information about the merging mechanism.

Add

Ribbon Page Merging - MergeType.Add

Show Code
<dx:ThemedWindow ...
    xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
    xmlns:dxb="http://schemas.devexpress.com/winfx/2008/xaml/bars"
    xmlns:dxdo="http://schemas.devexpress.com/winfx/2008/xaml/docking"
    xmlns:dxr="http://schemas.devexpress.com/winfx/2008/xaml/ribbon">
    <DockPanel>
        <dxr:RibbonControl>
            <dxr:RibbonPageCategory Caption="Text">
                <dxr:RibbonPage Caption="File">
                    <!-- Parent Ribbon's Page Group -->
                    <dxr:RibbonPageGroup Caption="File">
                        <dxb:BarButtonItem
                            Content="New"
                            LargeGlyph="{dx:DXImage Image=New_32x32.png}"
                            MergeOrder="0" />
                        <dxb:BarButtonItem
                            Content="Open"
                            Glyph="{dx:DXImage Image=Open_16x16.png}"
                            MergeOrder="1" />
                        <dxb:BarButtonItem
                            Content="Save"
                            Glyph="{dx:DXImage Image=Save_16x16.png}"
                            MergeOrder="2" />
                        <dxb:BarButtonItem
                            Content="Save As"
                            Glyph="{dx:DXImage Image=SaveAs_16x16.png}"
                            MergeOrder="3" />
                    </dxr:RibbonPageGroup>
                </dxr:RibbonPage>
            </dxr:RibbonPageCategory>
            <dxr:RibbonDefaultPageCategory>
                <!-- ... -->
            </dxr:RibbonDefaultPageCategory>
        </dxr:RibbonControl>
        <dxdo:DockLayoutManager>
            <dxdo:LayoutGroup>
                <dxdo:DocumentGroup>
                    <dxdo:DocumentPanel Caption="Document1">
                        <DockPanel>
                            <dxr:RibbonControl>
                                <dxr:RibbonPageCategory Caption="Text">
                                    <dxr:RibbonPage Caption="File">
                                        <!-- Child Ribbon's Page Group -->
                                        <dxr:RibbonPageGroup Caption="File" MergeType="Add">
                                            <dxb:BarButtonItem
                                                Content="Open"
                                                Glyph="{dx:DXImage Image=Open_16x16.png}"
                                                MergeOrder="1" />
                                            <dxb:BarButtonItem
                                                Content="Save"
                                                Glyph="{dx:DXImage Image=Save_16x16.png}"
                                                MergeOrder="2" />
                                            <dxb:BarButtonItem
                                                Content="Save As"
                                                Glyph="{dx:DXImage Image=SaveAs_16x16.png}"
                                                MergeOrder="3" />
                                        </dxr:RibbonPageGroup>
                                    </dxr:RibbonPage>
                                </dxr:RibbonPageCategory>
                                <dxr:RibbonDefaultPageCategory>
                                    <!-- ... -->
                                </dxr:RibbonDefaultPageCategory>
                            </dxr:RibbonControl>
                            <TextBox/>
                        </DockPanel>
                    </dxdo:DocumentPanel>
                </dxdo:DocumentGroup>
            </dxdo:LayoutGroup>
        </dxdo:DockLayoutManager>
    </DockPanel>
</dx:ThemedWindow>

Replace

Ribbon Page Merging - MergeType.Replace

Show Code
<dx:ThemedWindow ...
    xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
    xmlns:dxb="http://schemas.devexpress.com/winfx/2008/xaml/bars"
    xmlns:dxdo="http://schemas.devexpress.com/winfx/2008/xaml/docking"
    xmlns:dxr="http://schemas.devexpress.com/winfx/2008/xaml/ribbon">
    <DockPanel>
        <dxr:RibbonControl>
            <dxr:RibbonPageCategory Caption="Text">
                <dxr:RibbonPage Caption="File">
                    <!-- Parent Ribbon's Page Group -->
                    <dxr:RibbonPageGroup Caption="File">
                        <dxb:BarButtonItem
                            Content="New"
                            LargeGlyph="{dx:DXImage Image=New_32x32.png}"
                            MergeOrder="0" />
                        <dxb:BarButtonItem
                            Content="Open"
                            Glyph="{dx:DXImage Image=Open_16x16.png}"
                            MergeOrder="1" />
                        <dxb:BarButtonItem
                            Content="Save"
                            Glyph="{dx:DXImage Image=Save_16x16.png}"
                            MergeOrder="2" />
                        <dxb:BarButtonItem
                            Content="Save As"
                            Glyph="{dx:DXImage Image=SaveAs_16x16.png}"
                            MergeOrder="3" />
                    </dxr:RibbonPageGroup>
                </dxr:RibbonPage>
            </dxr:RibbonPageCategory>
            <dxr:RibbonDefaultPageCategory>
                <!-- ... -->
            </dxr:RibbonDefaultPageCategory>
        </dxr:RibbonControl>
        <dxdo:DockLayoutManager>
            <dxdo:LayoutGroup>
                <dxdo:DocumentGroup>
                    <dxdo:DocumentPanel Caption="Document1">
                        <DockPanel>
                            <dxr:RibbonControl>
                                <dxr:RibbonPageCategory Caption="Text">
                                    <dxr:RibbonPage Caption="File">
                                        <!-- Child Ribbon's Page Group -->
                                        <dxr:RibbonPageGroup Caption="File" MergeType="Replace">
                                            <dxb:BarButtonItem
                                                Content="Open"
                                                Glyph="{dx:DXImage Image=Open_16x16.png}"
                                                MergeOrder="1" />
                                            <dxb:BarButtonItem
                                                Content="Save"
                                                Glyph="{dx:DXImage Image=Save_16x16.png}"
                                                MergeOrder="2" />
                                            <dxb:BarButtonItem
                                                Content="Save As"
                                                Glyph="{dx:DXImage Image=SaveAs_16x16.png}"
                                                MergeOrder="3" />
                                        </dxr:RibbonPageGroup>
                                    </dxr:RibbonPage>
                                </dxr:RibbonPageCategory>
                                <dxr:RibbonDefaultPageCategory>
                                    <!-- ... -->
                                </dxr:RibbonDefaultPageCategory>
                            </dxr:RibbonControl>
                            <TextBox/>
                        </DockPanel>
                    </dxdo:DocumentPanel>
                </dxdo:DocumentGroup>
            </dxdo:LayoutGroup>
        </dxdo:DockLayoutManager>
    </DockPanel>
</dx:ThemedWindow>

MergeItems

Ribbon Category Merging - MergeType.MergeItems

Show Code
<dx:ThemedWindow ...
    xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
    xmlns:dxb="http://schemas.devexpress.com/winfx/2008/xaml/bars"
    xmlns:dxdo="http://schemas.devexpress.com/winfx/2008/xaml/docking"
    xmlns:dxr="http://schemas.devexpress.com/winfx/2008/xaml/ribbon">
    <DockPanel>
        <dxr:RibbonControl>
            <dxr:RibbonPageCategory Caption="Text">
                <dxr:RibbonPage Caption="File">
                <!-- Parent Ribbon's Page Group -->
                    <dxr:RibbonPageGroup Caption="File">
                        <dxb:BarButtonItem
                            Content="New"
                            LargeGlyph="{dx:DXImage Image=New_32x32.png}"
                            MergeOrder="0" />
                        <dxb:BarButtonItem
                            Content="Open"
                            Glyph="{dx:DXImage Image=Open_16x16.png}"
                            MergeOrder="1" />
                        <dxb:BarButtonItem
                            Content="Save"
                            Glyph="{dx:DXImage Image=Save_16x16.png}"
                            MergeOrder="2" />
                        <dxb:BarButtonItem
                            Content="Save As"
                            Glyph="{dx:DXImage Image=SaveAs_16x16.png}"
                            MergeOrder="3" />
                    </dxr:RibbonPageGroup>
                </dxr:RibbonPage>
            </dxr:RibbonPageCategory>
            <dxr:RibbonDefaultPageCategory>
                <!-- ... -->
            </dxr:RibbonDefaultPageCategory>
        </dxr:RibbonControl>
        <dxdo:DockLayoutManager>
            <dxdo:LayoutGroup>
                <dxdo:DocumentGroup>
                    <dxdo:DocumentPanel Caption="Document1">
                        <DockPanel>
                            <dxr:RibbonControl>
                                <dxr:RibbonPageCategory Caption="Text">
                                    <dxr:RibbonPage Caption="File">
                                    <!-- Child Ribbon's Page Group -->
                                        <dxr:RibbonPageGroup Caption="File" MergeType="MergeItems">
                                            <dxb:BarButtonItem
                                                Content="Open"
                                                Glyph="{dx:DXImage Image=Open_16x16.png}"
                                                MergeOrder="1" />
                                            <dxb:BarButtonItem
                                                Content="Save"
                                                Glyph="{dx:DXImage Image=Save_16x16.png}"
                                                MergeOrder="2" />
                                            <dxb:BarButtonItem
                                                Content="Save As"
                                                Glyph="{dx:DXImage Image=SaveAs_16x16.png}"
                                                MergeOrder="3" />
                                        </dxr:RibbonPageGroup>
                                    </dxr:RibbonPage>
                                </dxr:RibbonPageCategory>
                                <dxr:RibbonDefaultPageCategory>
                                    <!-- ... -->
                                </dxr:RibbonDefaultPageCategory>
                            </dxr:RibbonControl>
                            <TextBox/>
                        </DockPanel>
                    </dxdo:DocumentPanel>
                </dxdo:DocumentGroup>
            </dxdo:LayoutGroup>
        </dxdo:DockLayoutManager>
    </DockPanel>
</dx:ThemedWindow>

Remove

Ribbon Page Merging - MergeType.Remove

Show Code
<dx:ThemedWindow ...
    xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
    xmlns:dxb="http://schemas.devexpress.com/winfx/2008/xaml/bars"
    xmlns:dxdo="http://schemas.devexpress.com/winfx/2008/xaml/docking"
    xmlns:dxr="http://schemas.devexpress.com/winfx/2008/xaml/ribbon">
    <DockPanel>
        <dxr:RibbonControl>
            <dxr:RibbonPageCategory Caption="Text">
                <dxr:RibbonPage Caption="File">
                <!-- Parent Ribbon's Page Group -->
                    <dxr:RibbonPageGroup Caption="File">
                        <dxb:BarButtonItem
                            Content="New"
                            LargeGlyph="{dx:DXImage Image=New_32x32.png}"
                            MergeOrder="0" />
                        <dxb:BarButtonItem
                            Content="Open"
                            Glyph="{dx:DXImage Image=Open_16x16.png}"
                            MergeOrder="1" />
                        <dxb:BarButtonItem
                            Content="Save"
                            Glyph="{dx:DXImage Image=Save_16x16.png}"
                            MergeOrder="2" />
                        <dxb:BarButtonItem
                            Content="Save As"
                            Glyph="{dx:DXImage Image=SaveAs_16x16.png}"
                            MergeOrder="3" />
                    </dxr:RibbonPageGroup>
                </dxr:RibbonPage>
            </dxr:RibbonPageCategory>
            <dxr:RibbonDefaultPageCategory>
                <!-- ... -->
            </dxr:RibbonDefaultPageCategory>
        </dxr:RibbonControl>
        <dxdo:DockLayoutManager>
            <dxdo:LayoutGroup>
                <dxdo:DocumentGroup>
                    <dxdo:DocumentPanel Caption="Document1">
                        <DockPanel>
                            <dxr:RibbonControl>
                                <dxr:RibbonPageCategory Caption="Text">
                                    <dxr:RibbonPage Caption="File">
                                    <!-- Child Ribbon's Page Group -->
                                        <dxr:RibbonPageGroup Caption="File" MergeType="Remove">
                                            <dxb:BarButtonItem
                                                Content="Open"
                                                Glyph="{dx:DXImage Image=Open_16x16.png}"
                                                MergeOrder="1" />
                                            <dxb:BarButtonItem
                                                Content="Save"
                                                Glyph="{dx:DXImage Image=Save_16x16.png}"
                                                MergeOrder="2" />
                                            <dxb:BarButtonItem
                                                Content="Save As"
                                                Glyph="{dx:DXImage Image=SaveAs_16x16.png}"
                                                MergeOrder="3" />
                                        </dxr:RibbonPageGroup>
                                    </dxr:RibbonPage>
                                </dxr:RibbonPageCategory>
                                <dxr:RibbonDefaultPageCategory>
                                    <!-- ... -->
                                </dxr:RibbonDefaultPageCategory>
                            </dxr:RibbonControl>
                            <TextBox/>
                        </DockPanel>
                    </dxdo:DocumentPanel>
                </dxdo:DocumentGroup>
            </dxdo:LayoutGroup>
        </dxdo:DockLayoutManager>
    </DockPanel>
</dx:ThemedWindow>
See Also