wpf-7954-controls-and-libraries-ribbon-bars-and-menu-ribbon-ribbon-structure-ribbon-control.md
The RibbonControl is the main part of the Ribbon UI, designed to replace the toolbars and menus with tabbed pages. Each page contains various elements (buttons, sub-menus, in-place editors, galleries, etc.) that are combined into one or multiple groups.
The Ribbon Control is usually placed at the top of a window. We recommend that you use the ThemedWindow which supports integration with the Ribbon Control instead of the Window class.
The Ribbon Control consists of the following regions:
In addition, you can create a Ribbon Status Bar at the bottom of the window. This bar is painted to concur with the RibbonControl’s look and feel. You can add commands to this status bar, aligning them to the bar’s left and right edges.
Structurally, a RibbonControl consists of page categories, which are containers of ribbon pages. There are two types of page categories:
A page category contains pages as children, which are represented as tabs. An end-user can click a tab to access the commands displayed in it.
Ribbon pages consist of page groups. These visually divide all bar items into logical groups within each tab.
For details on each individual ribbon element, see the corresponding topics.
The Ribbon Control includes a smart layout that uses the available space to display as much information as possible (items, captions, etc.). For instance, if a page is stretched and has no place to display all available items, it automatically includes a button that displays sub-items in a drop-down panel.
The Ribbon Control’s Simplified Mode is an Office 2019-inspired single-line Ribbon mode.
You can use Simplified mode in the Office2007 , Office2010 , and Office2019 ribbon styles.
Follow the steps below to enable Simplified mode:
true.true.The following code snippet enables the Ribbon’s Simplified mode:
<dx:ThemedWindow x:Class="SimplifiedRibbon.MainWindow"
...
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
xmlns:dxb="http://schemas.devexpress.com/winfx/2008/xaml/bars"
xmlns:dxr="http://schemas.devexpress.com/winfx/2008/xaml/ribbon">
<dxr:RibbonControl RibbonStyle="Office2019" AllowSimplifiedRibbon="True" IsSimplified="True">
...
</dxr:RibbonControl>
</dx:ThemedWindow>
The Simplified Ribbon uses a 20x20 pixel glyph size. You can define it with the BarItem.MediumGlyph property. If you do not have 20x20 size glyphs, you can still use the classic 16x16 pixel size.
Ribbon Control includes the SimplifiedModeSettings.Location attached property that allows you to specify the Ribbon item’s location.
The following code snippet displays the Open ribbon item in Simplified mode only:
<dx:ThemedWindow x:Class="SimplifiedRibbon.MainWindow"
...
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
xmlns:dxb="http://schemas.devexpress.com/winfx/2008/xaml/bars"
xmlns:dxr="http://schemas.devexpress.com/winfx/2008/xaml/ribbon">
<dxr:RibbonControl RibbonStyle="Office2019">
<dxr:RibbonDefaultPageCategory>
<dxr:RibbonPage Caption="Home">
<dxr:RibbonPageGroup Caption="File">
<dxb:BarButtonItem x:Name="biOpen" Content="Open"
dxr:SimplifiedModeSettings.Location="Simplified"/>
</dxr:RibbonPageGroup>
</dxr:RibbonPage>
</dxr:RibbonDefaultPageCategory>
</dxr:RibbonControl>
</dx:ThemedWindow>
If you need to integrate the RibbonControl into the window header with side panels in the layout, set the SupportSidePanels property to true.
The following code snippet integrates the RibbonControl into the window header when there are side panels in the layout:
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Border Grid.Column="0" Grid.RowSpan="2" Width="50" Background="AliceBlue">
<TextBlock Text="Left" ... />
</Border>
<dxr:RibbonControl Grid.Column="1"
SupportSidePanels="True">
</dxr:RibbonControl>
<Border Grid.Column="2" Grid.RowSpan="2" Width="50" Background="AliceBlue">
<TextBlock Text="Right" ... />
</Border>
</Grid>
The Ribbon Control supports different paint styles (for instance, Microsoft Office 2007, Microsoft Office 2010, and Microsoft Office 2019). You can choose a paint style using the RibbonControl.RibbonStyle property.
See Also