Theming Support for WPF Native Controls
The Telerik themes provide styling for the Telerik controls and also several native WPF controls.
This article lists all the native WPF controls supporting Telerik theming, and shows how to enable the theming using the Style Manager and Implicit Styles mechanisms.
When using the Implicit Styles theming mechanism, the native controls are themed automatically when the Telerik's System.Windows.xaml file gets merged in the application resources.
When using the StyleManager theming, only the native controls used in the templates of the Telerik controls are automatically themed. All external WPF controls use their default theming.
Native controls supported by the Telerik theming mechanism
Below is the full control list of native WPF 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
System.Windows.Controls.Primitives.__StatusBar
System.Windows.Controls.GridSplitter
System.Windows.Controls.Separator
Additionally, there are two more controls part of the Telerik UI for WPF suite which mimic the WPF native Label and GroupBox. There are no styles for the native versions of those controls. The reason behind this decision is a legacy related to the Silverlight framework (now outdated), which shared a common codebase with WPF. In the Silverlight framework there wasn't 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 the 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.
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>
Resources
dictionary of the corresponding control.
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>
Resources
), you can set its Style property to an Style
object without any Setters
.
Disabling the default theming
<CheckBox Content="CheckBox">
<CheckBox.Style>
<Style TargetType="CheckBox"/>
</CheckBox.Style>
</CheckBox>
Setting the Theme Using StyleManager
To set the theme per control, use the StyleManager.Theme
attached property.
Setting a theme per control using StyleManager
<CheckBox Content="CheckBox" telerik:StyleManager.Theme="Windows11" />
StyleManager.Theme
property there.
Setting the Telerik theme globally for all CheckBox controls in the view
<Application.Resources>
<Style TargetType="CheckBox">
<Setter Property="telerik:StyleManager.Theme" Value="Windows11" />
</Style>
</Application.Resources>