Ribbon Window
Bars includes a RibbonWindow class, which is an implementation of the Window
class specifically designed to simplify hosting a Ribbon control.
It is always recommended that a RibbonWindow is only used when hosting a Ribbon control implementation.
While a RibbonWindow can be used without a Ribbon control at all, the control template includes additional UI elements specific to hosting a Ribbon. The following example demonstrates a minimal configuration:
<actipro:RibbonWindow ...
xmlns:actipro="http://schemas.actiprosoftware.com/avaloniaui">
<actipro:RibbonContainerPanel>
<!-- Define the ribbon here -->
<actipro:Ribbon ... >
<!-- Additional ribbon configuration here -->
</actipro:Ribbon>
<!-- Define other window content here, such as a document display area -->
</actipro:RibbonContainerPanel>
</actipro:RibbonWindow>
ChromedTitleBar Usage
Each RibbonWindow has a default ChromedTitleBar as part of the control template whose LeftContent is configured to host the ribbon Quick Access Toolbar when it is shown above the ribbon.
Customizing the Title Bar
The title bar can be customized by applying a ControlTheme
to the TitleBarTheme property.
Important
Any ControlTheme
must be based on the default ControlTheme
or the LeftContent will no longer be configured to host the Quick Access Toolbar.
The following example demonstrates using a ControlTheme
to allow the Full Screen caption button and place additional content in the RightContent.
<actipro:RibbonWindow ...
xmlns:actipro="http://schemas.actiprosoftware.com/avaloniaui">
<actipro:RibbonWindow.TitleBarTheme>
<ControlTheme TargetType="actipro:ChromedTitleBar" BasedOn="{actipro:ControlTheme RibbonWindowTitleBar}">
<Setter Property="IsFullScreenButtonAllowed" Value="True" />
<Setter Property="RightContentTemplate">
<DataTemplate>
<TextBlock VerticalAlignment="Center">Right content here</TextBlock>
</DataTemplate>
</Setter>
</ControlTheme>
</actipro:RibbonWindow.TitleBarTheme>
...
</actipro:RibbonWindow>
See the ChromedTitleBar topic for additional information on configuring the title bar.