Edit this page

Change the Default Theme

You can easily change the theme of RadWindow to one of the predefined themes for UI for WPF using the Implicit Styles.

So, in order to set a theme to the Window, you should merge the following xaml files in App.xaml file:

  • Telerik.Windows.Controls.xaml

  • Telerik.Windows.Controls.Navigation.xaml

As RadWindow is placed in a different visual tree than the UserControl it is opened from, the xaml files should be merged in App.xaml, if you merge them locally in the UserControl Resources, RadWindow will not receive its Style.

So merging the mentioned xaml files, for example, for Windows8 theme:

XAML

<Application>
    <Application.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/Telerik.Windows.Themes.Windows8;component/Themes/Telerik.Windows.Controls.xaml"/>
                <ResourceDictionary Source="/Telerik.Windows.Themes.Windows8;component/Themes/Telerik.Windows.Controls.Navigation.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Application.Resources>
</Application>

And opening a RadWindow:

C#

var window = new RadWindow()
{
    Width = 300,
    Height = 300
};
window.Show();

VB.NET

Dim newWindow As New RadWindow() With {
    .Width = 300,
    .Height = 300
}
newWindow.Show()

Here is a snapshot of the result.

If you have RadWindow as an user control like this:

XAML

<telerik:RadWindow x:Class="RadWindowSamples.RadWindowControl"
   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">
</telerik:RadWindow>

it will not receive automatically the Window style. You should add the following Style after the merged dictionaries to fix this:

XAML

<Application>
    <Application.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/Telerik.Windows.Themes.Windows8;component/Themes/Telerik.Windows.Controls.xaml"/>
                <ResourceDictionary Source="/Telerik.Windows.Themes.Windows8;component/Themes/Telerik.Windows.Controls.Navigation.xaml"/>
            </ResourceDictionary.MergedDictionaries>
            <Style TargetType="local:RadWindowControl" BasedOn="{StaticResource RadWindowStyle}" />
        </ResourceDictionary>
    </Application.Resources>
</Application>

The important part is setting TargetType property to the type of the user control.

To learn more about how to use the RadWindow as user control read this topic.

See Also