Partilhar via


Ribbon (WPF)

The ribbon is a command bar that organizes the features of an application into a series of tabs at the top of the application window. The ribbon user interface (UI) increases discoverability of features and functions, enables quicker learning of the application, and makes users feel more in control of their experience with the application. The ribbon replaces the traditional menu bar and toolbars.

The Microsoft Ribbon for Windows Presentation Foundation (WPF) is a WPF implementation of ribbon that includes all of the basic ribbon features and functionality, including tabs, groups, controls, a Quick Access Toolbar, integration with the window title bar, and resizing with dynamic layout.

Observação

This documentation is specific to the Microsoft Ribbon for WPF. If you are just starting with the ribbon, or need general information about the ribbon UI, please see the Ribbons topic in the Windows User Experience Interaction Guidelines. For documentation specific to other ribbon implementations, see the Additional Resources section at the end of this topic.

Ribbon Components and Features

The ribbon control is made up several components. Every ribbon has an Application Menu, a Quick Access Toolbar, tabs, groups, and controls. Ribbon tabs contain groups, and each group contains controls. Ribbon controls include simple controls such as buttons, check boxes, and text boxes; and menu controls such as combo boxes, split buttons, and menu buttons. Related controls can be further combined into control groups. In addition to the required components, a ribbon can also include optional components, such as contextual tabs, enhanced ToolTips, and galleries.

The following illustration shows a simple text editor application with a ribbon command bar, similar to the Windows 7 WordPad application.

Ribbon with large controls

Application Menu

Every ribbon includes an Application Menu as the first tab in the ribbon. Other ribbon tabs contain controls for working with the document content. In contrast, the Application Menu presents a menu of commands for working with the file. Examples include commands that traditionally go in the File menu to create, open, save, and print files. It is also used to access application options and the Exit command.

The following illustration shows the Application Menu for a ribbon control.

Ribbon Application Menu

Quick Access Toolbar

Every ribbon includes a Quick Access Toolbar. The Quick Access Toolbar is a small, customizable toolbar that provides access to frequently used commands independent of which ribbon tab is selected. By default, the Quick Access Toolbar is located in the title bar of the application window, but it can be configured to display below the ribbon. You specify a default set of commands that appear in the Quick Access Toolbar, and the user can also select commands from the ribbon to appear in the Quick Access Toolbar.

Enhanced ToolTips

Ribbon controls have enhanced ToolTips that enable you to completely describe the associated command. You can also include graphics to illustrate the effects of the command.

The following illustration shows an enhanced ToolTip for a ribbon control.

Enhanced ToolTip

KeyTips

Every ribbon enables keyboard navigation through the use of KeyTips. KeyTips appear for all tabs in a ribbon when the ALT key is pressed. When the letter or number associated with a tab is pressed, the KeyTips for all controls on that tab are shown. When the key associated with a control is pressed, that control is selected and the associated action is performed.

The following illustration shows the KeyTips for a ribbon control.

Ribbon with KeyTips

Resizing and Layout

The ribbon dynamically resizes to always display as many controls as possible in the optimal layout as the application window gets narrower or wider. The ribbon also adjusts its contents for left-to-right or right-to-left document flow. For more information about dynamic resizing, see Ribbon Layout and Resizing.

Ribbon Window

Some ribbon components, such as the Quick Access Toolbar and contextual tab headers, are drawn in the non-client area of the application window title bar. This is accomplished in the Microsoft Ribbon for WPF by using the root element RibbonWindow instead of the root element Window. The RibbonWindow class implements the interop code which is needed to render the necessary ribbon components in the title bar area. It is not required that the Microsoft Ribbon for WPF is used within the RibbonWindow element, but if title bar integration is needed, it is the simplest way to achieve it. If the RibbonWindow element is not used, all components will be drawn in the client area of the window.

Downloading and Installing the Microsoft Ribbon for WPF

The Microsoft Ribbon for WPF is a stand-alone control that can be used with the .NET Framework 3.5 SP1 and later versions. You can download the Microsoft Ribbon for WPF installer from the Microsoft Download Center. The installer includes the assemblies and license files that are required to use the ribbon, and project templates and designer support for Visual Studio 2010 and Expression Blend 4.

To download the Microsoft Ribbon for WPF and view the reference documentation, see the following resources.

Additional Resources

For information about the Microsoft Office Ribbon, see the following resources.

For information about the Microsoft Windows 7 Ribbon Framework, see the following resources.

For information about the MFC Ribbon, see the following resources.