'宣言 Public ReadOnly Property PreviewItems As ReadOnlyObservableCollection(Of GalleryItem)
public ReadOnlyObservableCollection<GalleryItem> PreviewItems {get;}
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 ShowPreviewItems() For Each item As GalleryItem In galleryTool.PreviewItems Console.WriteLine("The preview item text is: {0}", item.Text) 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 ShowPreviewItems() { foreach (GalleryItem item in galleryTool.PreviewItems) { Console.WriteLine("The preview item text is: {0}", item.Text); } } } }