'Declaration Public Class XamRibbon Inherits Infragistics.Windows.Controls.IGControlBase Implements IKeyTipContainer
public class XamRibbon : Infragistics.Windows.Controls.IGControlBase, IKeyTipContainer
The XamRibbon is a custom control for providing the look and behavior of the Microsoft Office 2007 Ribbon. The main properties of the Ribbon are the QuickAccessToolbar, ApplicationMenu and the Tabs.
The QuickAccessToolbar is a toolbar that is displayed above or below the Ribbon based on the QuickAccessToolbarLocation and is used to display commonly used tools to the end user. The end user may add tools to the QAT using the right click context menu or tools may be programatically added to the QuickAccessToolbar using a QatPlaceholderTool. You can also add tools to the ToolsNotInRibbon if you have an instance of a tool that will not be visible to the end user within a RibbonGroup or the ApplicationMenu but will be added to the QAT.
The ApplicationMenu is a specialized menu that is displayed as a round button within the upper left corner of the XamRibbon and contains 3 specialized areas for containing tools that are used to perform actions that are general to the application or window.
The Tabs are a collection of RibbonTabItem instances that are used to logically and visually organize the tools used to perform various actions within the application. The SelectedTab is used to control which tab item's contents are visible to the end user. The SelectNextTab and SelectPreviousTab methods may be used to navigate within the tabs or you can set the System.Windows.Controls.TabItem.IsSelected property of a visible tab to true.
The XamRibbon also provides support for creating ContextualTabGroup instances. These objects are added to the ContextualTabGroups collection and when their ContextualTabGroup.IsVisible is true, their ContextualTabGroup.Tabs are displayed after the non-contextual tabs with a caption above the tab item headers.
The XamRibbonWindow may be used to host the XamRibbon to provide the same style rounded forms that are used within Microsoft Office 2007. The IsWithinRibbonWindow is set to true when the XamRibbon is hosted within the Ribbon of a XamRibbonWindow.
The XamRibbon supports the ability to minimize using the IsMinimized property and may also be minimized via the UI using the right click context menu or by pressing Ctrl-F1. When the Ribbon is minimized, the contents of the selected tab are hidden and the height of the Ribbon is reduced. When a tab is selected (via the mouse, keyboard, keytips or programatically setting the SelectedTab), the contents of the selected tab are displayed within a popup above the content of the containing window. The AllowMinimize property can be used to prevent the minimized state of the ribbon from being changed in the UI.
The look of the XamRibbon may be changed using the Theme property and supports values such as Office2k7Black, Office2k7Blue and Office2k7Silver to provide the same style color schemes as you would find in Microsoft Office 2007. You can also provide modified modified washed versions of these color schemes using the Infragistics.Windows.Themes.ResourceWasher.
The XamRibbon supports the ability to automatically hide when the width and/or height of the containing form fall below specified threshold values. This behavior is disabled by default but can be enabled by setting the AutoHideEnabled property to true. When true, the AutoHideState of the Ribbon will be changed to Hidden when either the width or height fall below the AutoHideHorizontalThreshold or AutoHideVerticalThreshold values of the containing form respectively.
Public Partial Class CodeRibbonWindow Inherits XamRibbonWindow Private xamRibbon As XamRibbon Public Sub New() InitializeComponent() initRibbonItems() End Sub Private Sub initRibbonItems() 'Create RibbonWindowContentHost Dim xamContentHost As New RibbonWindowContentHost() Me.Content = xamContentHost 'Create XamRibbon object xamRibbon = New XamRibbon() xamContentHost.Ribbon = xamRibbon DockPanel.SetDock(xamRibbon, Dock.Top) End Sub End Class
public partial class CodeRibbonWindow : XamRibbonWindow { XamRibbon xamRibbon; public CodeRibbonWindow() { InitializeComponent(); initRibbonItems(); } private void initRibbonItems() { //Create RibbonWindowContentHost RibbonWindowContentHost xamContentHost = new RibbonWindowContentHost(); this.Content = xamContentHost; //Create XamRibbon object xamRibbon = new XamRibbon(); xamContentHost.Ribbon = xamRibbon; DockPanel.SetDock(xamRibbon, Dock.Top); } }
Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2