'Declaration Public Class GalleryItem Inherits Infragistics.DependencyObjectNotifier
public class GalleryItem : Infragistics.DependencyObjectNotifier
While GalleryItems can appear in both the GalleryTool preview area and GalleryTool dropdown, GalleryItems only appear inside assigned GalleryItemGroups in the GalleryTool dropdown since the GalleryTool preview area never displays GalleryItemGroups. By default, the GalleryTool contains no GalleryItemGroups and therefore GalleryItems by default do not appear within a GalleryItemGroup in the dropdown area. To display a GalleryItem in a GalleryItemGroup in the dropdown, you must add the GalleryItem's Key value to the GalleryItemGroup.ItemKeys collection for each GalleryItemGroup in which you would like the GalleryItem to appear.
Note: You may assign GalleryItems to more than one GalleryItemGroup. In this case they will appear in multiple GalleryItemGroups in the GalleryTool dropdown. However, they will only appear once in the GalleryTool preview area.
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 galleryTool As New GalleryTool() menuTool.Items.Add(galleryTool) galleryTool.Groups.Clear() galleryTool.Items.Clear() Dim group As New GalleryItemGroup() group.Title = "Group" galleryTool.Groups.Add(group) For ind As Integer = 1 To 10 Dim item As New GalleryItem() item.Key = "Item" + ind.ToString() item.Text = settings.Name 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() { GalleryTool galleryTool = new GalleryTool(); menuTool.Items.Add(galleryTool); galleryTool.Groups.Clear(); galleryTool.Items.Clear(); GalleryItemGroup group = new GalleryItemGroup(); group.Title = "Group"; galleryTool.Groups.Add(group); for (int ind = 1; ind <= 10; ind++) { GalleryItem item = new GalleryItem(); item.Key = "Item" + ind.ToString(); item.Text = settings.Name; item.Image = new BitmapImage(new Uri("\\Images\\ig_office_icon_16.png", UriKind.Relative)); galleryTool.Items.Add(item); group.ItemKeys.Add(item.Key); } } } }
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