Control Hierarchy
Ribbon supports many complex scenarios. This topic provides an overview of how the ribbon is defined, which properties are populated, and which controls are typically used for those properties. Each type is linked to its corresponding API documentation. Where applicable, additional topics are cited for a more detailed discussion of a particular feature.
RibbonWindow
The following hierarchy shows a high-level structure a window that defines a ribbon:
- RibbonWindow :
Window
(see Ribbon Window topic)- RibbonContainerPanel :
Panel
- Ribbon
- Other content
- RibbonContainerPanel :
Important
The RibbonContainerPanel
should be used as the container for a Ribbon
and the content that appears below the ribbon. The two controls work together to provide smooth animations based on ribbon state changes. While the RibbonContainerPanel
is not required, it improves the end-user experience.
Defining Ribbon Within ContentControl
For composible UI frameworks like Prism, it may not be reasonable to define a Ribbon
directly as a child of a RibbonContainerPanel
. In these scenarios, a ContentControl
can be used as the direct child of a RibbonContainerPanel
as long as the ContentControl.Content
is initialized to an instance of Ribbon
at run-time. When hosted in a ContentControl
, it is recommended to set the Panel.ZIndex
of the ContentControl
to 1
for the ribbon's shadow chrome to display correctly.
The following sample demonstrates how a ContentControl
might be configured within a RibbonContainerPanel
:
<bars:RibbonWindow ...
xmlns:bars="http://schemas.actiprosoftware.com/winfx/xaml/bars">
<bars:RibbonContainerPanel>
<!-- Ribbon Placeholder -->
<ContentControl x:Name="ribbonContent" Panel.ZIndex="1" />
<!-- Other main window content here -->
</bars:RibbonContainerPanel>
</bars:RibbonWindow>
In the code-behind, the ribbonContent.Content
should be assigned an instance of Ribbon
.
Ribbon
The following hierarchy shows the definition of a Ribbon control and the typical types (with their own hierarchies) that are assigned to important properties.
Note
Any ItemsControl
listed below that does not explicitly identify a property as a child in the hierarchy should be assumed to be the Items
or ItemsSource
property. Likewise, the child of a ContentControl
should be assumed to be the Content
property.
- Ribbon :
ItemsControl
- QuickAccessToolBarContent :
object
(see Quick Access Toolbar topic)- RibbonQuickAccessToolBar :
ItemsControl
- CommonItems :
IEnumerable
- Toolbar controls (e.g.,
BarButton
... see "Toolbar Controls" section)
- Toolbar controls (e.g.,
ItemsControl.Items
- Toolbar controls (e.g.,
BarButton
... see "Toolbar Controls" section)
- Toolbar controls (e.g.,
- CommonItems :
- RibbonQuickAccessToolBar :
- ApplicationButtonContent :
object
(see Application Menu topic)- RibbonApplicationButton :
Menu
,ItemsControl
- MenuAdditionalContent
- RecentDocumentControl :
ItemsControl
(suggested content, see Recent Documents topic)- RecentDocumentItem :
Button
- RecentDocumentItem :
- Any object
- RecentDocumentControl :
- MenuFooter
- Any object (
BarButton
recommended for Key Tips support)
- Any object (
ItemsControl.Items
- Menu controls (e.g.,
BarMenuItem
... see "Menu Controls" section)
- Menu controls (e.g.,
- MenuAdditionalContent
- RibbonApplicationButton :
- BackstageContent :
object
(see Backstage topic)- RibbonBackstage :
TabControl
,ItemsControl
- RibbonBackstageTabItem :
TabItem
ContentControl.Content
(commonly used backstage controls listed below)- TaskTabControl :
TabControl
,ItemsControl
- TaskTabItem :
TabItem
- TaskTabItem :
- RecentDocumentControl :
ItemsControl
(see Recent Documents topic)- RecentDocumentItem :
Button
- RecentDocumentItem :
BarButton
,BarPopupButton
(with backstage styles applied)- Any object
- TaskTabControl :
- RibbonBackstageHeaderButton :
Button
- RibbonBackstageHeaderSeparator :
Separator
- RibbonBackstageTabItem :
- RibbonBackstage :
- FooterContent :
object
(see Footer topic)- RibbonFooterControl :
ContentControl
- Any object
- RibbonFooterControl :
- TabRowToolBarContent :
object
(see Tab Row Toolbar topic)- RibbonTabRowToolBar :
ItemsControl
- Toolbar controls (e.g.,
BarButton
... see "Toolbar Controls" section)
- Toolbar controls (e.g.,
- RibbonTabRowToolBar :
- ContextualTabGroups :
IEnumerable
(see Contextual Tabs topic)- RibbonContextualTabGroup :
Control
- RibbonContextualTabGroup :
ItemsControl.Items
- RibbonTabItem :
ItemsControl
(see Tabs, Groups, and Control Groups topic)- RibbonGroup :
ItemsControl
(see Tabs, Groups, and Control Groups topic)- RibbonControlGroup :
ItemsControl
(see Tabs, Groups, and Control Groups topic)- Toolbar controls (e.g.,
BarButton
... see "Toolbar Controls" section)
- Toolbar controls (e.g.,
- RibbonMultiRowControlGroup :
ItemsControl
(see Tabs, Groups, and Control Groups topic)- RibbonControlGroup or toolbar controls (e.g.,
BarButton
... see "Toolbar Controls" section)
- RibbonControlGroup or toolbar controls (e.g.,
- Toolbar controls (e.g.,
BarButton
... see "Toolbar Controls" section)
- RibbonControlGroup :
- RibbonGroup :
- RibbonTabItem :
- QuickAccessToolBarContent :
Toolbar Controls
The following controls can appear within the context of a toolbar and show their respective hierarchies:
- BarButton :
Button
(see Button topic) - BarPopupButton :
Menu
,ItemsControl
(see Popup Button topic)- Menu controls (e.g.,
BarMenuItem
... see "Menu Controls" section)
- Menu controls (e.g.,
- BarToggleButton :
Button
(see Button topic) - BarSplitButton :
Menu
,ItemsControl
(see Split Button topic)- Menu controls (e.g.,
BarMenuItem
... see "Menu Controls" section)
- Menu controls (e.g.,
- BarSplitToggleButton :
Menu
,ItemsControl
(see Split Button topic)- Menu controls (e.g.,
BarMenuItem
... see "Menu Controls" section)
- Menu controls (e.g.,
- RibbonGallery :
ItemsControl
(see Gallery topic)- AboveMenuItems :
IEnumerable
- Optional additional menu controls above the gallery items (e.g.,
BarMenuItem
... see "Menu Controls" section)
- Optional additional menu controls above the gallery items (e.g.,
ItemsControl.Items
- BarGalleryItem :
ContentControl
- BarGalleryItem :
- BelowMenuItems :
IEnumerable
- Optional additional menu controls below the gallery items (e.g.,
BarMenuItem
... see "Menu Controls" section)
- Optional additional menu controls below the gallery items (e.g.,
- AboveMenuItems :
- BarCheckBox :
Button
(see Checkbox topic) - BarComboBox :
ItemsControl
(see Combobox topic)- AboveMenuItems :
IEnumerable
- Optional additional menu controls above the gallery items (e.g.,
BarMenuItem
... see "Menu Controls" section)
- Optional additional menu controls above the gallery items (e.g.,
ItemsControl.Items
- BarGalleryItem :
ContentControl
- BarGalleryItem :
- BelowMenuItems :
IEnumerable
- Optional additional menu controls below the gallery items (e.g.,
BarMenuItem
... see "Menu Controls" section)
- Optional additional menu controls below the gallery items (e.g.,
- AboveMenuItems :
- BarTextBox :
TextBox
(see Textbox topic) - BarSeparator :
Separator
(see Separator topic)
Menu Controls
The following controls can appear within the context of a menu and show their respective hierarchies:
- BarMenuItem :
MenuItem
,ItemsControl
(see Button and Popup Button topics)- Optional menu controls for sub menu (e.g.,
BarMenuItem
)
- Optional menu controls for sub menu (e.g.,
- BarSplitMenuItem :
MenuItem
,ItemsControl
(see Split Button topic)- Menu controls for sub menu (e.g.,
BarMenuItem
)
- Menu controls for sub menu (e.g.,
- BarMenuGallery :
ItemsControl
(see Gallery topic)- BarGalleryItem :
ContentControl
- BarGalleryItem :
- BarMenuHeading :
MenuItem
(see Heading topic) - BarMenuSeparator :
Separator
(see Separator topic)