Use StyleManager to Apply Theme on MS Controls

The Telerik themes are designed to work mainly with our controls and some native Silverlight controls. Our theming mechanism cannot cover the full control list included in Silverlight.

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

For all of those controls you may specify the theme for them as you may for any Telerik control.

When you apply an Application theme at runtime, though, only Telerik controls will be styled - not the native ones supported by our theming mechanism. If you want to style those native controls based on the current application theme, you should manually set the corresponding theme. For example, the code for a Button would be like so:

<Application xmlns=""&#13;             xmlns:x=""&#13;             xmlns:telerik=""&#13;             x:Class="RadCalcTest.App">
        <Style TargetType="Button"/>

public App()
      this.Startup += this.Application_Startup;
      this.Exit += this.Application_Exit;
      this.UnhandledException += this.Application_UnhandledException;
      StyleManager.ApplicationTheme = new Windows7Theme();
     StyleManager.SetBasedOn(((Style)Current.Resources[typeof(Button)]), StyleManager.ApplicationTheme);
Public Sub New()
    Me.Startup += Me.Application_Startup
    Me.[Exit] += Me.Application_Exit
    Me.UnhandledException += Me.Application_UnhandledException
    StyleManager.ApplicationTheme = New Windows7Theme()
    StyleManager.SetBasedOn(DirectCast(Current.Resources(GetType(Button)), Style), StyleManager.ApplicationTheme)
End Sub

See Also

In this article
Not finding the help you need? Improve this article