'Declaration Public Class ContextualTabGroupCollection Inherits Infragistics.Collections.ObservableCollectionExtended(Of ContextualTabGroup)
public class ContextualTabGroupCollection : Infragistics.Collections.ObservableCollectionExtended<ContextualTabGroup>
Represents a grouping of RibbonTabItems that relates to a specific context that has meaning to the application that is hosting the XamRibbon.
Private xamRibbon As XamRibbon 'Code to create XamRibbon object Private Sub addContextualTabGroups() 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 'Collection for range od ContextualtabGroups Dim CTGList As New Infragistics.Windows.Helpers.ObservableCollectionExtended(Of ContextualTabGroup)() 'Add ContextualtabGroups in collection 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) Dim layoutTabItem As New RibbonTabItem() layoutTabItem.Header = "Layout" contextualTG.Tabs.Add(layoutTabItem) Dim secondTabItem As New RibbonTabItem() secondTabItem.Header = "SecondCTab" secondTG.Tabs.Add(secondTabItem) 'Add RibbonGroups in ContextualTabItems addRibbonGroupsInContextualtabItems() End Sub Private Sub addRibbonGroupsInContextualtabItems() 'add Ribbon Groups in ContextualTabItems 'Code to Add RibbonGroups ... End Sub
XamRibbon xamRibbon; //Code to create XamRibbon object 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; //Collection for range od ContextualtabGroups Infragistics.Windows.Helpers.ObservableCollectionExtended<ContextualTabGroup> CTGList = new Infragistics.Windows.Helpers.ObservableCollectionExtended<ContextualTabGroup>(); //Add ContextualtabGroups in collection 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); RibbonTabItem layoutTabItem = new RibbonTabItem(); layoutTabItem.Header = "Layout"; contextualTG.Tabs.Add(layoutTabItem); RibbonTabItem secondTabItem = new RibbonTabItem(); secondTabItem.Header = "SecondCTab"; secondTG.Tabs.Add(secondTabItem); //Add RibbonGroups in ContextualTabItems addRibbonGroupsInContextualtabItems(); } //add Ribbon Groups in ContextualTabItems private void addRibbonGroupsInContextualtabItems() { //Code to Add RibbonGroups ... }
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