バージョン

Ribbon プロパティ

XamRibbonWindow を含むキャプション エリア内で表示される XamRibbon コントロールを取得または設定します。
シンタックス
'宣言
 
Public Property Ribbon As XamRibbon
public XamRibbon Ribbon {get; set;}
使用例
Public Partial Class CodeRibbonWindow 
    Inherits XamRibbonWindow 
    Private xamRibbon As XamRibbon 
    Public Sub New() 
        InitializeComponent() 
        initRibbonItems() 
    End Sub 
    
    Private Sub initRibbonItems() 
        'Create RibbonWindowContentHost 
        Dim xamContentHost As New RibbonWindowContentHost() 
        Me.Content = xamContentHost 
        'Create XamRibbon object 
        xamRibbon = New XamRibbon() 
        xamContentHost.Ribbon = xamRibbon 
        DockPanel.SetDock(xamRibbon, Dock.Top) 
    End Sub 
End Class
public partial class CodeRibbonWindow : XamRibbonWindow
{
	XamRibbon xamRibbon;
	public CodeRibbonWindow()
	{
		InitializeComponent();
		initRibbonItems();
	}
	
	private void initRibbonItems()
	{
		//Create RibbonWindowContentHost
		RibbonWindowContentHost xamContentHost = new RibbonWindowContentHost();
		this.Content = xamContentHost;
		//Create XamRibbon object
		xamRibbon = new XamRibbon();
		xamContentHost.Ribbon = xamRibbon;
		DockPanel.SetDock(xamRibbon, Dock.Top);
	}
}
<igRibbon:XamRibbonWindow x:Class="SnippetApplication.RibbonWindow"
    
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    
xmlns:s="clr-namespace:System;assembly=mscorlib" 
    
xmlns:igRibbon="http://infragistics.com/Ribbon"
    
xmlns:igEditors="http://infragistics.com/Editors"
    
xmlns:igWindows="http://infragistics.com/Windows"         
    
Title="Xaml Ribbon Samples" Height="300" Width="600"
    
WindowStartupLocation="CenterScreen">
    
<igRibbon:RibbonWindowContentHost>

        
<igRibbon:RibbonWindowContentHost.Ribbon>
            
<!--XamRibbon-->
            
<igRibbon:XamRibbon x:Name="myRibbon" DockPanel.Dock="Top">
            
<!--XamRibbon items .... -->
            
</igRibbon:XamRibbon>
            
<!--XamRibbon-end-->
        
</igRibbon:RibbonWindowContentHost.Ribbon>    
    
</igRibbon:RibbonWindowContentHost>
</igRibbon:XamRibbonWindow    >
参照