'宣言 Public Class ContextualTabGroupCollection Inherits Infragistics.Collections.ObservableCollectionExtended(Of ContextualTabGroup)
public class ContextualTabGroupCollection : Infragistics.Collections.ObservableCollectionExtended<ContextualTabGroup>
XamRibbon をホストしているアプリケーションに意味を持つ特定のコンテキストに関係する RibbonTabItem のグループ化を表します。
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 ... }