'Declaration Public Class ContextualTabGroup Inherits Infragistics.DependencyObjectNotifier
public class ContextualTabGroup : Infragistics.DependencyObjectNotifier
ContextualTabGroup instances are added to the XamRibbon.ContextualTabGroups property. A contextual tab group is made up of one or more RibbonTabItem instances. The tabs of a ContextualTabGroup are displayed after all the tabs that do not belong to a ContextualTabGroup. When possible, the Caption of the group is displayed in the caption area of the XamRibbon above the tab items it contains.
The IsVisible property may be used to show/hide the group and therefore the Tabs it contains.
The BaseBackColor can be used to control the base color that affects the appearance of the caption of the ContextualTabGroup in the Ribbon's caption area as well as the general appearance of the tab item header and context area of the items within the group's Tabs collection.
The ContextualTabGroup class is not a System.Windows.Media.Visual. If you want to control the appearance of the group within the caption area of the XamRibbon, you need to create a System.Windows.DataTemplate that targets the ContextualTabGroup type.
Private Sub addContextualTabGroups() 'add Ribbon Contextual Tab Groups Dim contextualTG As New ContextualTabGroup() contextualTG.Caption = "Sample CTG" contextualTG.Key = "CG1" contextualTG.BaseBackColor = Colors.Aqua contextualTG.IsVisible = True xamRibbon.ContextualTabGroups.Add(contextualTG) 'AddRange of ContextualTabGroups Dim secondTG As New ContextualTabGroup() secondTG.Caption = "Second CTG" secondTG.Key = "CG2" secondTG.IsVisible = True Dim trirdTG As New ContextualTabGroup() trirdTG.Caption = "Third CTG" trirdTG.Key = "CG3" trirdTG.IsVisible = True Dim CTGList As New Infragistics.Windows.Helpers.ObservableCollectionExtended(Of ContextualTabGroup)() CTGList.Add(secondTG) CTGList.Add(trirdTG) xamRibbon.ContextualTabGroups.AddRange(CTGList) 'add tabs to Contextual Tab Groups Dim designTabItem As New RibbonTabItem() designTabItem.Header = "Desin" contextualTG.Tabs.Add(designTabItem) 'contextualTG.Key = "AB1"; Dim layoutTabItem As New RibbonTabItem() layoutTabItem.Header = "Layout" contextualTG.Tabs.Add(layoutTabItem) Dim secondTabItem As New RibbonTabItem() secondTabItem.Header = "SecondCTab" secondTG.Tabs.Add(secondTabItem) 'secondTG.Key = "AB2"; addRibbonGroupsInContextualtabItems() End Sub
//add Ribbon Contextual Tab Groups private void addContextualTabGroups() { ContextualTabGroup contextualTG = new ContextualTabGroup(); contextualTG.Caption = "Sample CTG"; contextualTG.Key = "CG1"; contextualTG.BaseBackColor = Colors.Aqua; contextualTG.IsVisible = true; xamRibbon.ContextualTabGroups.Add(contextualTG); //AddRange of ContextualTabGroups ContextualTabGroup secondTG = new ContextualTabGroup(); secondTG.Caption = "Second CTG"; secondTG.Key = "CG2"; secondTG.IsVisible = true; ContextualTabGroup trirdTG = new ContextualTabGroup(); trirdTG.Caption = "Third CTG"; trirdTG.Key = "CG3"; trirdTG.IsVisible = true; Infragistics.Windows.Helpers.ObservableCollectionExtended<ContextualTabGroup> CTGList = new Infragistics.Windows.Helpers.ObservableCollectionExtended<ContextualTabGroup>(); CTGList.Add(secondTG); CTGList.Add(trirdTG); xamRibbon.ContextualTabGroups.AddRange(CTGList); //add tabs to Contextual Tab Groups RibbonTabItem designTabItem = new RibbonTabItem(); designTabItem.Header = "Desin"; contextualTG.Tabs.Add(designTabItem); //contextualTG.Key = "AB1"; RibbonTabItem layoutTabItem = new RibbonTabItem(); layoutTabItem.Header = "Layout"; contextualTG.Tabs.Add(layoutTabItem); RibbonTabItem secondTabItem = new RibbonTabItem(); secondTabItem.Header = "SecondCTab"; secondTG.Tabs.Add(secondTabItem); //secondTG.Key = "AB2"; addRibbonGroupsInContextualtabItems(); }
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