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 component. This component provides the DocumentGroup and DocumentPanel containers that help you create native and tabbed MDI interfaces. The following animation illustrates how ribbon merging operates.
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 property that affects all child panels within a 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 attached property instead. This property has a higher priority than the DockLayoutManager.MDIMergeStyle property.
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 topic for information on available merging options. To change merge types for ribbon elements, use the RibbonPageCategoryBase.MergeType, RibbonPage.MergeType, RibbonPageGroup.MergeType and BarItemLinkBase.MergeType properties.
Merging these Ribbon Controls will result in the page arrangement shown below.
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.
The merging operation is not irreversible. Unmerging is performed via the RibbonControl.UnMerge and RibbonStatusBarControl.UnMerge 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 event, which is the reverse of the 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.
/// Interaction logic for MainWindow.xaml
public partial class MainWindow : DXRibbonWindow
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;
''' Interaction logic for MainWindow.xaml
Partial Public Class MainWindow
Public Sub New()
Private Sub biMDI_ItemClick(ByVal sender As Object, ByVal e As DevExpress.Xpf.Bars.ItemClickEventArgs)
ChildDocumentGroup.MDIStyle = MDIStyle.MDI
Private Sub biTabbed_ItemClick(ByVal sender As Object, ByVal e As DevExpress.Xpf.Bars.ItemClickEventArgs)
ChildDocumentGroup.MDIStyle = MDIStyle.Tabbed