Version

RibbonWindowContentHost Class

A custom System.Windows.Controls.ContentControl designed to be used as the System.Windows.Controls.ContentControl.Content of a XamRibbonWindow in order to display a XamRibbon, a System.Windows.Controls.Primitives.StatusBar and the actual content for the window.
Syntax
'Declaration
 
Public Class RibbonWindowContentHost 
   Inherits System.Windows.Controls.ContentControl
public class RibbonWindowContentHost : System.Windows.Controls.ContentControl 
Remarks

The RibbonWindowContentHost class is designed to be used as the content of the XamRibbonWindow in rich client applications to enable the placement of a XamRibbon in the caption area (i.e., non-client area) of the window. When the XamRibbon is used in a standard System.Windows.Window or on a System.Windows.Controls.Page, it appears inside the bounds of the window’s or page’s client area.

The RibbonWindowContentHost exposes 3 main properties - Ribbon, StatusBar and System.Windows.Controls.ContentControl.Content. The Ribbon property should be set to an instance of a XamRibbon that will be displayed within the caption area of the containing XamRibbonWindow. The StatusBar may optionally be set to a System.Windows.Controls.Primitives.StatusBar that will be displayed at the bottom of the content. The Content property is used to specify the control or element that represents the client area of the window. This property is normally set to a derived System.Windows.Controls.Panel that then contains the controls that make up the main client area of the window.

Example
XamRibbon Sample

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    >
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also