Setting a Theme on MS Controls

The Telerik themes are designed to work with Telerik controls and several native Silverlight controls.

This article lists all the native Silverlight controls supporting Telerik theming, and shows how to enable the theming using the Style Manager and Implicit Styles mechanisms.

Native controls supported by the Telerik theming mechanism

Below is the full control list of native Silverlight controls supported by the Telerik theming mechanism:

  • System.Windows.Controls.Button

  • System.Windows.Controls.ScrollViewer

  • System.Windows.Controls.CheckBox

  • System.Windows.Controls.TextBox

  • System.Windows.Controls.RadioButton

  • System.Windows.Controls.ListBox

  • System.Windows.Controls.PasswordBox

  • System.Windows.Controls.Primitives.RepeatButton

  • System.Windows.Controls.Tooltip

  • System.Windows.Documents.Hyperlink

Additionally, there are two more controls part of the Telerik UI for Silverlight suite which mimic the WPF native Label and GroupBox. There are no styles for the native versions of those controls because of the Silverlight version of the Telerik's suite (Telerik UI for Silverlight). In the Silverlight framework there are no native Label and GroupBox controls so they were created in the Telerik suite in order to provide them to the Silverlight users and also to enable the theming support.

  • Telerik.Windows.Controls.Label

  • Telerik.Windows.Controls.GroupBox

Before proceeding with this tutorial, you can check the Setting a Theme topic.

Setting a Theme Using Implicit Styles

To set the theme to all controls in the application, merge the corresponding ResourceDictionary (System.Windows.xaml). This will ensure that the native controls used in the Telerik ones will have the correct theme applied. In this case, any instance of the native controls which is separately defined will also get the Telerik theme.

Example 1: Merging the System.Windows.xaml file

<Application.Resources> 
    <ResourceDictionary> 
        <ResourceDictionary.MergedDictionaries> 
            <ResourceDictionary Source="/Telerik.Windows.Themes.Office2013;component/Themes/System.Windows.xaml"/> 
            <!-- the other Telerik resource here --> 
        </ResourceDictionary.MergedDictionaries> 
    </ResourceDictionary> 
</Application.Resources> 
To set the theme seprately per control, you can merge the System.Windows.xaml resource in the Resources dictionary of the corresponding control.

Example 2: Setting a theme per control using implicit styles

<CheckBox Content="CheckBox">    
    <CheckBox.Resources> 
        <ResourceDictionary Source="/Telerik.Windows.Themes.Office2013;component/Themes/System.Windows.xaml"/> 
    </CheckBox.Resources> 
</CheckBox> 
To avoid applying the theme to a specific native control after the global theming setting (in the App.xaml Resources), you can set its Style property to an Style object without any Setters.

Example 3: Disabling the default theming

<CheckBox Content="CheckBox">    
    <CheckBox.Style> 
        <Style TargetType="CheckBox"/> 
    </CheckBox.Style> 
</CheckBox> 

Setting a Theme Using StyleManager

When using StyleManager, the theme can be set only per control. There is no global setting that will apply to all native controls in the view.

To set the theme per control, use the StyleManager.Theme attached property.

Example 4: Setting a theme per control using StyleManager

<CheckBox Content="CheckBox" telerik:StyleManager.Theme="Office2013" /> 

See Also

In this article