'宣言 Public Property ItemSettings As GalleryItemSettings
public GalleryItemSettings ItemSettings {get; set;}
GalleryTool レベルで指定された GalleryItemSettings ( GalleryTool.ItemSettings プロパティを介して) 内のさまざまなプロパティ値は、すべての GalleryItem の最終的なデフォルト設定として機能します。これらの値は以下の 2 つの低いレベルでオーバーライドされる場合があります。
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); } } } }