バージョン

Key プロパティ (ContextualTabGroup)

ContextualTabGroupCollectionContextualTabGroup のキーを取得または設定します。
シンタックス
'宣言
 
Public Property Key As String
public string Key {get; set;}
例外
例外解説
System.InvalidOperationExceptionその Key プロパティ値がコレクション内の既存の ContextualTabGroupKey プロパティの値と競合する ContextualTabGroup への追加が試みられる場合。
解説

ContextualTabGroup の Key は必須ではありませんが、ContextualTabGroups コレクション内でグループを探すための便利な方法を提供します。Key が提供されると、Ribbon の ContextualTabGroups コレクション内でその他の ContextualTabGroup インスタンスを基準として一意でなければなりません。

使用例
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);
}
<!-- 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="8"/>
                                    
<Label Width="50" Content="9"/>
                                    
<Label Width="50" Content="10"/>
                                
</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>
参照