# Ribbon Window

The **RadRibbonWindow** control is used to replace the **Window** control that represents the root UI of a WPF application. Its purpose is to allow a smoother UI when hosting the **RadRibbonView** at the root level of the application.

**Figure 1** demonstrates the result, after placing a **RadRibbonView** in the **MainWindow** of your WPF application.

> caption RadRibbonView inside MainWindow

![RadRibbonWindow inside MainWindow](https://www.telerik.com/products/wpf/documentation/assets/160e0e3a78875bfdce029a1b6fbc80e0/radribbonview-features-controls-window-wpf-0.png)

You will have two title bars which makes the UI messy. The **RadRibbonWindow** integrates with the **RadRibbonView** and prevents this. In order to use the **RadRibbonWindow** you have to replace the **Window** control in your **MainWindow** class with the **RadRibbonWindow** one.

**Example 1: Replacing Window with RadRibbonWindow**

```XAML
<telerik:RadRibbonWindow 
	        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	        xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
	        Title="MainWindow" Height="350" Width="525">
    <Grid>
        <telerik:RadRibbonView />
    </Grid>
</telerik:RadRibbonWindow>
```

**Example 2: Inheriting RadRibbonWindow**

```C#
public partial class MainWindow : RadRibbonWindow
{
    // code
}
```

```VB.NET
	Public Partial Class MainWindow
		Inherits RadRibbonWindow
		Public Sub New()
			InitializeComponent()
		End Sub
	End Class
```

> caption RadRibbonWindow as MainWindow

![RadRibbonWindow as MainWindow](https://www.telerik.com/products/wpf/documentation/assets/96db209f4674b9c4dff673c2bfcc5e66/radribbonview-features-controls-window-wpf-1.png)

By default, when you add a **RadRibbonView** in a **RadRibbonWindow**, the components are integrated together to create a seamless UI experience. For that purpose the **QuickAccessToolbar** as well as the **ApplicationName**  and the **Title** of the **RadRibbonView** are displayed in the title tray of the **RadRibbonWindow**. In this case, the value of the **RadRibbonWindow Title** is ignored.

## Icon

In order to provide a custom icon for the RadRibbonWindow, you have to set its **Icon** property as demonstrated in **Example 3**.

**Example 3: Providing a custom Icon**

```XAML
<telerik:RadRibbonWindow Icon="Images/application-icon.ico"/>
```

## Title Visibility

With **Q1 2014** we introduced a new property, which you can use to control this behavior. The **IsTitleVisible** property is of type **bool** and it defines whether the **RadRibbonWindow Title** should be displayed. The default value of the property is **false**, but when changed to **true**, it makes the **RibbonWindow** display its own **Title**. In that case the **RadRibbonView** title bar - the **QuickAccessToolbar, Title** and **ApplicationName** are displayed underneath the window's title.

**Example 4: Setting IsTitleVisible**

```XAML
<telerik:RadRibbonWindow 
	                         xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	                         xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	                         xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
	                         Title="MainWindow"
	                         Width="525"
	                         Height="350"
	                         IsTitleVisible="True">
    <Grid>
        <telerik:RadRibbonView Title="RibbonView Title" ApplicationName="My Application">
            <telerik:RadRibbonView.QuickAccessToolBar>
                <telerik:QuickAccessToolBar>
                    <telerik:RadRibbonButton Foreground="White" Text="Option 1" />
                </telerik:QuickAccessToolBar>
            </telerik:RadRibbonView.QuickAccessToolBar>
            <telerik:RadRibbonTab Header="Home">
                <telerik:RadRibbonGroup Header="Clipboard">
                    <telerik:RadRibbonSplitButton LargeImage="paste.png"
	                                                  Size="Large"
	                                                  Text="Paste"
	                                                  telerik:ScreenTip.Description="Paste the contents the Clipboard."
	                                                  telerik:ScreenTip.Title="Paste(Ctrl+V)">
                        <telerik:RadRibbonSplitButton.DropDownContent>
                            <telerik:RadContextMenu BorderThickness="0">
                                <telerik:RadMenuItem Header="Paste" />
                                <telerik:RadMenuItem Header="Paste Form" />
                            </telerik:RadContextMenu>
                        </telerik:RadRibbonSplitButton.DropDownContent>
                    </telerik:RadRibbonSplitButton>
                </telerik:RadRibbonGroup>
            </telerik:RadRibbonTab>
            <telerik:RadRibbonTab Header="View" />
        </telerik:RadRibbonView>
    </Grid>
</telerik:RadRibbonWindow>
```

> caption RadRibbonWindow with visible title

![Rad Ribbon View Ribbon Window Visible Title](https://www.telerik.com/products/wpf/documentation/assets/cf04ede216b94cc464c38214faf89e0a/radribbonview-features-controls-window-wpf-2.png)

## Setting a Theme

By default the **RadRibbonWindow** uses the Windows OS theme. However, you can also apply any of the Telerik predefined themes. In order to do so, you need to set the **RadRibbonWindow\.IsWindowsThemeEnabled** static property to **False** in the static constructor of the **RadRibbonWindow** or in the constructor of the **App** class.

**Example 5: Setting IsWindowsThemeEnabled**

```C#
public partial class MainWindow : RadRibbonWindow
{
    static MainWindow()
    {
        RadRibbonWindow.IsWindowsThemeEnabled = false;
    }
    public MainWindow()
    {
        //code 
    }
}
```

```VB.NET
	Partial Public Class MainWindow
		Inherits RadRibbonWindow
		Shared Sub New()
			RadRibbonWindow.IsWindowsThemeEnabled = False
		End Sub
		Public Sub New()
			InitializeComponent()
		End Sub
	End 
```

In order to apply a Telerik style on the **RadRibbonWindow**, it is best to use the implicit styling mechanism further described in the [Setting a Theme (Using Implicit Styles)](http://www.telerik.com/help/wpf/styling-apperance-implicit-styles-overview.html) tutorial.

Please note that the default **RadRibbonWindow** implicit style cannot be applied on derived controls as their **Type** is different than the one defined as a **TargetType** in the implicit style. This is why in order to apply a Telerik predefined style on a **Window/UserControl** deriving from **RadRibbonWindow** you need to define a **Style** targeting the **Window/UserControl** type in the **Resources** of the application. Make sure to define that style after merging the Telerik **ResourseDictionaries** so that you can base it on the predefined **"RadRibbonWindowStyle"**.

**Example 6: Basing the MainWindow style on the RadRibbonWindowStyle**

```XAML
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <Style TargetType="local:MainWindow" BasedOn="{StaticResource RadRibbonWindowStyle}" />
</ResourceDictionary>
```

**Example 7: Merging the needed resources**

```XAML
<Application.Resources>
    <ResourceDictionary>
        <ResourceDictionary.MergedDictionaries>
            <ResourceDictionary Source="/Telerik.Windows.Themes.Office2016;component/Themes/System.Windows.xaml" />
            <ResourceDictionary Source="/Telerik.Windows.Themes.Office2016;component/Themes/Telerik.Windows.Controls.xaml" />
            <ResourceDictionary Source="/Telerik.Windows.Themes.Office2016;component/Themes/Telerik.Windows.Controls.Input.xaml" />
            <ResourceDictionary Source="/Telerik.Windows.Themes.Office2016;component/Themes/Telerik.Windows.Controls.Navigation.xaml" />
            <ResourceDictionary Source="/Telerik.Windows.Themes.Office2016;component/Themes/Telerik.Windows.Controls.RibbonView.xaml" />
            <ResourceDictionary Source="RibbonWindowStyle.xaml" />
        </ResourceDictionary.MergedDictionaries>
    </ResourceDictionary>
</Application.Resources>
```

> caption RadRibbonWindow in the Office2016 theme

![Rad Ribbon View Ribbon WindowWPF Office2016 Theme](https://www.telerik.com/products/wpf/documentation/assets/4f49b5ecedcfceeb931a2415dbd4dbf5/radribbonview-features-controls-window-wpf-3.png)

## Customize Appearance

You can customize the window's appearance by setting its various properties via the appropriate style.

**Example 8: Adding a CornerRadius to the RadRibbonWindow**

```XAML

<Style TargetType="local:MainWindow" BasedOn="{StaticResource RadRibbonWindowStyle}"
		xmlns:shell="clr-namespace:Telerik.Windows.Controls.RibbonView.Shell;assembly=Telerik.Windows.Controls.RibbonView">
    <Setter Property="CornerRadius" Value="20"/>
    <Setter Property="shell:WindowChrome.WindowChromeCornerRadius" Value="20"/>
</Style>
```
