'宣言 Public Property SmallImage As ImageSource
public ImageSource SmallImage {get; set;}
Imports System Imports System.Windows Imports Infragistics.Windows.Ribbon Namespace MyNamespace Public Partial Class MyWindow Inherits XamRibbonWindow Public Sub New() InitializeComponent() End Sub Private Sub SetupGalleryTool() galleryTool.SmallImage = New BitmapImage(New Uri("\Images\ig_office_icon_16.png", UriKind.Relative)) galleryTool.LargeImage = New BitmapImage(New Uri("\Images\ig_office_icon_32.png", UriKind.Relative)) 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(); } private void SetupGalleryTool() { galleryTool.SmallImage = new BitmapImage(new Uri("\\Images\\ig_office_icon_16.png", UriKind.Relative)); galleryTool.LargeImage = new BitmapImage(new Uri("\\Images\\ig_office_icon_32.png", UriKind.Relative)); } } }