注: が選択され、複数の GalleryItemGroup に指定されている場合、これらの 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 item As New GalleryItem() item.Key = "Item1" item.Text = "First Item" item.Image = New BitmapImage(New Uri("\Images\ig_office_icon_16.png", UriKind.Relative)) item.IsSelected = True galleryTool.Items.Add(item) 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() { GalleryItem item = new GalleryItem(); item.Key = "Item1"; item.Text = "First Item"; item.Image = new BitmapImage(new Uri("\\Images\\ig_office_icon_16.png", UriKind.Relative)); item.IsSelected = true; galleryTool.Items.Add(item); } } }