The ribbon's Quick Access Toolbar (QAT) can be displayed either above the ribbon (in the window's title bar) or below the ribbon depending on the end user's preference. It provides quick access to the most commonly used commands in your application.
A ribbon quick access toolbar above and below the ribbon
Defining a Quick Access Toolbar
The quick access toolbar can be defined in XAML or code-behind by assigning a Ribbon
Note
See the "MVVM Support" section below for details on alternatively using this property to define the toolbar via MVVM techniques.
The items to be displayed in the toolbar are assigned to the RibbonItems
collection. Since the control derives from ItemsControl
, items may alternatively be bound into the controls's ItemsSource
property.
To make it easy for users to add or remove common items from the toolbar, additional items can be assigned to the RibbonItems
collection.
Important
Only the items in the Items
collection are displayed in the toolbar.
This code sample shows how to define the quick access toolbar items for a ribbon.
XAML Support
Defining the quick access toolbar in XAML may require duplicating some control definitions if the same control is defined, by default, in both the quick access toolbar and the ribbon. Duplication may also be required if a control currently displayed in the quick access toolbar is also included in the common items.
Important
When more than one control definition exists for what is effectively the same command, it is important that all control definitions are assigned the same value for the Key
property.
Warning
By default, users can add controls from the ribbon to the quick access toolbar. This requires cloning the original control since the same control cannot be displayed in two locations at the same time, and cloning has limitations. Refer to the XAML vs. MVVM Configuration topic for additional details. Controls can set the attached Barfalse
to disable moving the control to the quick access toolbar if cloning is an issue.
MVVM Support
The quick access toolbar may also be defined by setting the Ribbon.Quick
The optional companion MVVM Library defines a Ribbon
Tip
See the MVVM Support topic for more information on how to use the library's view models and view templates to create and manage your application's bars controls with MVVM techniques.
Customizing the Toolbar Theme
The RibbonControlTheme
to the Ribbon.QuickControlTheme
is applied to the control when it is added to the ribbon.
Quick Access Toolbar Mode
The toolbar visibility can be toggled or completely hidden from the user. The Ribbon
Toggle Visibility
Setting the mode to Visible will show the toolbar in the desired location and setting the mode to Hidden will hide it from the user interface.
The user can toggle visibility from various menus on the ribbon, like the Options Button.
The Ribbon.Quick
Disabling the Toolbar
By default, all ribbons have a quick access toolbar. If the toolbar will not be used, set the Ribbon.Quick
Quick Access Toolbar Location
The toolbar can be located either above or below the ribbon. The Ribbon.Quick
The Ribbon.Quick
Note
When the ribbon is hosted in a Ribbon Window and the location is set to Ribbon
External Host
When the location is set to RibbonTopLevel
and setting the Ribbon.Allowtrue
.
Hiding the Customize Button
The Ribbonfalse
to hide the customize button that appears next to the QAT.
Customizing the Customize Button's Menu
Ribbon supports dynamic customization of the Customize button's menu at run-time.
See the Menu Customization topic for a section with additional details on customizing the default menu.
Tip
See the "Customize Built-in Menus" Bars Ribbon QuickStart of the Sample Browser application for a full demonstration of customizing menus.
Persisting End-User Run-Time Item Customizations
Ribbon includes a very flexible framework for supporting multiple forms of end-user customization. If end-user customization is allowed, users will expect those customizations to persist between application sessions.
See the Serialization topic for details on how to persist the state of the quick access toolbar to be restored later.
Key Tips
Key tips for controls in the quick access toolbar are auto-generated, beginning with numbers. In some cases, the numbers might conflict with a ribbon tab that also uses a key tip beginning with a number. In this scenario, the Key'Q'
, which will prefix the auto-generated key tip text, thereby removing the conflict.
See the Key Tips topic for additional details on key tips in general.