Version

ItemSettings Property (GalleryItemGroup)

Returns/sets the settings that serve as the default settings for all GalleryItems in this GalleryItemGroup.
Syntax
'Declaration
 
Public Property ItemSettings As GalleryItemSettings
public GalleryItemSettings ItemSettings {get; set;}
Remarks

The various property values in the GalleryItemSettings specified at the GalleryTool level (via the GalleryTool.ItemSettings property) serve as the ultimate defaults for all GalleryItems. These values can be overridden at two lower levels:

Example
The following example shows how to use the ItemSettings property to specify the settings that serve as the default settings for all GalleryItems in this GalleryItemGroup.

Imports System
Imports System.Windows
Imports Infragistics.Windows.Ribbon


Namespace MyNamespace
    Public Partial Class MyWindow
        Inherits XamRibbonWindow
        Public Sub New()
            InitializeComponent()
        End Sub
       
        Protected Sub LoadGalleryTool()
           Dim setting As New GalleryItemSettings()
           setting.TextDisplayMode = GalleryItemTextDisplayMode.Always
           setting.TextPlacement = TextPlacement.AboveImage
           setting.HorizontalTextAlignment = TextAlignment.Center
           setting.VerticalTextAlignment = VerticalAlignment.Top
           setting.SelectionDisplayMode = GalleryItemSelectionDisplayMode.HighlightEntireItem
           
            Dim group As New GalleryItemGroup()
            group.Title = "Group"
            group.ItemSettings = setting
           
            galleryTool.Groups.Add(group)
            For ind As Integer = 1 To 3
               
                Dim item As New GalleryItem()
                item.Key = "Item" + ind.ToString()
                item.Text = "Item" + ind.ToString()
                item.Image = New BitmapImage(New Uri("\Images\ig_office_icon_16.png", UriKind.Relative))
               
                galleryTool.Items.Add(item)
                group.ItemKeys.Add(item.Key)
            Next
        End Sub
    End Class
End Namespace
using System;
using System.Windows;
using Infragistics.Windows.Ribbon;


namespace MyNamespace
{
    public partial class MyWindow : XamRibbonWindow
    {
        public MyWindow()
        {
            InitializeComponent();
        }

        protected void LoadGalleryTool()
        {
            GalleryItemSettings setting = new GalleryItemSettings();
            setting.TextDisplayMode = GalleryItemTextDisplayMode.Always;
            setting.TextPlacement = TextPlacement.AboveImage;
            setting.HorizontalTextAlignment = TextAlignment.Center;
            setting.VerticalTextAlignment = VerticalAlignment.Top;
            setting.SelectionDisplayMode = GalleryItemSelectionDisplayMode.HighlightEntireItem;

            GalleryItemGroup group = new GalleryItemGroup();
            group.Title = "Group";
            group.ItemSettings = setting;

            galleryTool.Groups.Add(group);

            for (int ind = 1; ind <= 3; ind++)
            {
                GalleryItem item = new GalleryItem();
                item.Key = "Item" + ind.ToString();
                item.Text = "Item" + ind.ToString();
                item.Image = new BitmapImage(new Uri("\\Images\\ig_office_icon_16.png", UriKind.Relative));

                galleryTool.Items.Add(item);
                group.ItemKeys.Add(item.Key);
            }
        }
    }
}
<igRibbon:XamRibbonWindow x:Class="MyWindow"
    
xmlns:igRibbon="http://infragistics.com/Ribbon"
    
xmlns:s="clr-namespace:System;assembly=mscorlib">

  ....

  
<igRibbon:RibbonGroup Id="ConnectionGallery" Caption="ConnectionGallery">
    
<igRibbon:MenuTool ShouldDisplayGalleryPreview="True" Caption="Connections">
      
<igRibbon:GalleryTool Name="galleryTool"
                            
Id="galleryToolID"
                            
AllowResizeDropDown="True"
                            
Caption="Connection"
                            
IsQatCommonTool="True"
                            
ItemBehavior="Button"
                            
ItemClicked="galleryTool_ItemClicked"
                            
KeyTip="GT">
                                    
<igRibbon:GalleryTool.Groups>
                                        
<igRibbon:GalleryItemGroup Title="Group1">
                                            
<igRibbon:GalleryItemGroup.ItemSettings>
                                                
<igRibbon:GalleryItemSettings 
                                                    
TextDisplayMode="Always" 
                                                    
TextPlacement="AboveImage" 
                                                    
HorizontalTextAlignment="Center" 
                                                    
VerticalTextAlignment="Top"
                                                    
SelectionDisplayMode="HighlightEntireItem"/>
                                            
</igRibbon:GalleryItemGroup.ItemSettings>
                                            
<s:String>Item1</s:String>
                                            
<s:String>Item2</s:String>
                                            
<s:String>Item3</s:String>
                                        
</igRibbon:GalleryItemGroup>
                                    
</igRibbon:GalleryTool.Groups>

        
<igRibbon:GalleryTool.Items>
          
<igRibbon:GalleryItem Key="Item1" Text="Item1" Image="\Images\ig_office_icon_16.png"/>
          
<igRibbon:GalleryItem Key="Item2" Text="Item2" Image="\Images\ig_office_icon_16.png"/>
          
<igRibbon:GalleryItem Key="Item3" Text="Item3" Image="\Images\ig_office_icon_16.png"/>
        
</igRibbon:GalleryTool.Items>
      
</igRibbon:GalleryTool>
    
</igRibbon:MenuTool>

  
</igRibbon:RibbonGroup>

  ....

</igRibbon:XamRibbonWindow>
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