'宣言 Public ReadOnly Property Location As ToolLocation
public ToolLocation Location {get;}
可能なツール配置は Ribbon、Menu、QuickAccessToolbar、ApplicationMenu、ApplicationMenuFooterToolbar、および ApplicationMenuRecentItems です。
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 CheckGalleryTool() ' Location If galleryTool.Location = ToolLocation.ApplicationMenu Then ' do something if gallery's location is Application menu ElseIf galleryTool.Location = ToolLocation.Ribbon Then ' do something else if gallery's location is Ribbon Else ' do something else End If 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 CheckGalleryTool() { // Location if (galleryTool.Location == ToolLocation.ApplicationMenu) { // do something if gallery's location is Application menu } else if (galleryTool.Location == ToolLocation.Ribbon) { // do something else if gallery's location is Ribbon } else { // do something else } } } }