New to Telerik UI for WPF? Download free 30-day trial

Setting a Theme

The purpose of this article is to show you how to set a built-in theme to RadDesktopAlert.

RadDesktopAlert supports styling using Implicit Styles. Detailed information about the use of Implicit Styles you could find here.

The following Xaml files should be merger in App.xaml file in order a theme to be correctly applied to the DesktopAlert:

  • Telerik.Windows.Controls.xaml

  • Telerik.Windows.Controls.Navigation.xaml

You could do that using one of the following approaches:

  • Directly from the theme assembly:

    For example let's apply VisualStudio2013 theme to RadDesktopAlert - a reference to Telerik.Windows.Themes.VisualStudio2013.dll should be added as well:

    Figure 1: Adding the needed references
    Rad Desktop Alert Setting Theme 01

    After that merge the xaml files in the App.xaml as shown in Example 1:

    Example 1: Merging the .xaml files

                <ResourceDictionary Source="/Telerik.Windows.Themes.VisualStudio2013;component/Themes/Telerik.Windows.Controls.xaml" /> 
                <ResourceDictionary Source="/Telerik.Windows.Themes.VisualStudio2013;component/Themes/Telerik.Windows.Controls.Navigation.xaml" /> 
  • Add references to the required assemblies from Binaries.NoXaml folder. Create a Themes folder in your project that contains the corresponding .xaml files from Themes.Implicit/../VisualStudio2013/../Themes/ folder located in the installation folder:

    Figure 2: Copying the .xaml files Rad Desktop Alert Setting Theme 01

    Example 2 shows how to merge the copied .xaml files.

    Example 2: Merging the .xaml files

            <ResourceDictionary Source="Themes/Telerik.Windows.Controls.xaml" /> 
            <ResourceDictionary Source="Themes/Telerik.Windows.Controls.Navigation.xaml" /> 

    Either way you choose, the end result will be the following:

Figure 3: DesktopAlert with VisualStudio2013 theme applied Rad Desktop Alert Setting Theme 03

See Also

In this article