'Declaration Public ReadOnly Property Tabs As ContextualTabItemCollection
public ContextualTabItemCollection Tabs {get;}
The Tabs property represents the collection of RibbonTabItem instances associated with the ContextualTabGroup. Items added to the collection will have their RibbonTabItem.ContextualTabGroup property set to this instance. This allows the tabs to access the BaseBackColorResolved within their templates.
Note: the RibbonTabItems in this collection are not contained in the Tabs collection but ARE contained in the XamRibbon.TabsInView read-only collection if the IsVisible property of the ContextualTabGroup is set to true.
Private xamRibbon As XamRibbon 'Code to Create XamRibbon object.. Private Sub contextualTabGroupProperties() 'ContextualTabGroup properties Dim contextualTG As New ContextualTabGroup() contextualTG.Caption = "Sample CTG" 'Caption contextualTG.Key = "CG1" 'Color contextualTG.BaseBackColor = Colors.Aqua 'BaseBackColor contextualTG.IsVisible = True 'IsVisible xamRibbon.ContextualTabGroups.Add(contextualTG)'add tabs to Contextual Tab Groups Dim designTabItem As New RibbonTabItem() designTabItem.Header = "Desin" contextualTG.Tabs.Add(designTabItem) Dim layoutTabItem As New RibbonTabItem() layoutTabItem.Header = "Layout" contextualTG.Tabs.Add(layoutTabItem) End Sub
XamRibbon xamRibbon; //Code to Create XamRibbon object.. //ContextualTabGroup properties private void contextualTabGroupProperties() { ContextualTabGroup contextualTG = new ContextualTabGroup(); contextualTG.Caption = "Sample CTG"; //Caption contextualTG.Key = "CG1"; //Color contextualTG.BaseBackColor = Colors.Aqua; //BaseBackColor contextualTG.IsVisible = true; //IsVisible xamRibbon.ContextualTabGroups.Add(contextualTG); //add tabs to Contextual Tab Groups RibbonTabItem designTabItem = new RibbonTabItem(); designTabItem.Header = "Desin"; contextualTG.Tabs.Add(designTabItem); RibbonTabItem layoutTabItem = new RibbonTabItem(); layoutTabItem.Header = "Layout"; contextualTG.Tabs.Add(layoutTabItem); }
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