In This Article

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:

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:

xmlns:bars="http://schemas.actiprosoftware.com/winfx/xaml/bars"
...
<bars:RibbonWindow>
	<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.

Toolbar Controls

The following controls can appear within the context of a toolbar and show their respective hierarchies:

The following controls can appear within the context of a menu and show their respective hierarchies: