'Declaration Public Class XamRibbonWindow Inherits System.Windows.Window
public class XamRibbonWindow : System.Windows.Window
The XamRibbonWindow class is derived from the WPF System.Windows.Window class. It is designed to be used with the XamRibbon in rich client applications to enable the placement of the XamRibbon in the caption area (i.e., non-client area) of the window. When the XamRibbon is used in a standard WPF System.Windows.Window or on a WPF System.Windows.Controls.Page, it appears inside the bounds of the window’s or page’s non-client area.
Note: The only System.Windows.Controls.ContentControl.Content that should be placed inside this window is a RibbonWindowContentHost. The XamRibbon is associated with this window by setting the RibbonWindowContentHost.Ribbon property of the RibbonWindowContentHost to an instance of a XamRibbon.
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); } }
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