Version

ContextualTabGroupCollection Class

An observable collection of ContextualTabGroups.
Syntax
'Declaration
 
Public Class ContextualTabGroupCollection 
   Inherits Infragistics.Collections.ObservableCollectionExtended(Of ContextualTabGroup)
public class ContextualTabGroupCollection : Infragistics.Collections.ObservableCollectionExtended<ContextualTabGroup> 
Remarks

Represents a grouping of RibbonTabItems that relates to a specific context that has meaning to the application that is hosting the XamRibbon.

Example
ContextualTabGroupCollection Sample

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 ...
}
<igRibbon:XamRibbon.ContextualTabGroups>

<!-- Create a ContextualTabGroup.There are 6 different ContextualTabGroup Colors: Orange, Purple, Blue, Green, Yellow, and Red. -->
<igRibbon:ContextualTabGroup Key="SelectionGroup" Caption="Selection" IsVisible="True">
    
<igRibbon:ContextualTabGroup.Tabs>

        
<!-- Add a RibbonTabItem to this ContextualTabGroup.  Multiple TabItems can be added
        to the same ConxtextualTabGroup.  Each Tab will contain the same color as the ContextualTabGroup. 
-->
        
<igRibbon:RibbonTabItem Header="Font Selection">
            
<igRibbon:RibbonGroup Id="FontSelection" Caption="Font">
                
<igRibbon:ToolHorizontalWrapPanel>
                    
<igRibbon:ComboEditorTool
                      
Id="fontFamilyCombo_Selection"
                      
x:Name="fontFamilyCombo_Selection"
                      
DropDownResizeMode="VerticalOnly"
                      
IsEditable="False" Caption="Font Size"
                      
EditAreaWidth="148.0" Value="Arial">
                            
<igRibbon:ComboEditorTool.ItemsProvider>
                                
<igEditors:ComboBoxItemsProvider>
                                    
<Label Content="Arial"/>
                                    
<Label Content="Arial Black"/>
                                    
<Label Content="Calibri"/>
                                    
<Label Content="Times New Roman"/>
                                
</igEditors:ComboBoxItemsProvider>
                            
</igRibbon:ComboEditorTool.ItemsProvider>
                        
</igRibbon:ComboEditorTool>
                    
                    
<igRibbon:ComboEditorTool
                      
Id="fontSizeCombo_Selection"`
                      x:Name="fontSizeCombo_Selection"
                      IsEditable="False"
                      
DropDownResizeMode="VerticalOnly"
                      
EditAreaWidth="118.0" Caption="Font Size"
                      
ValueType="{x:Type s:Double}" Value="10" >
                            
<igRibbon:ComboEditorTool.ItemsProvider>
                                
<igEditors:ComboBoxItemsProvider>
                                    
<Label Width="50" Content="7"/>
                                    
<Label Width="50" Content="8"/>
                                    
<Label Width="50" Content="9"/>
                                
</igEditors:ComboBoxItemsProvider>
                            
</igRibbon:ComboEditorTool.ItemsProvider>
                        
</igRibbon:ComboEditorTool>
                    
                    
<igRibbon:MenuTool
                        
igRibbon:RibbonGroup.MaximumSize="ImageOnly"
                        
SmallImage="Images\icons\Ribbon\FontColor.png" >
                        
<TextBlock Text="Colors"/>
                    
</igRibbon:MenuTool>
                
</igRibbon:ToolHorizontalWrapPanel>
            
</igRibbon:RibbonGroup>
        
</igRibbon:RibbonTabItem>

    
</igRibbon:ContextualTabGroup.Tabs>
</igRibbon:ContextualTabGroup>

</igRibbon:XamRibbon.ContextualTabGroups>
Requirements

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

See Also