Expression Dark Theme on non-Telerik controls

3 posts, 0 answers
  1. Ron
    Ron avatar
    9 posts
    Member since:
    Jul 2011

    Posted 27 Sep 2011 Link to this post

    I set the theme in my application to the Telerik Expression_DarkTheme, but non-Telerik controls (Buttons, TextBoxes, etc.) don't have the Expression Dark style. It looks like they should by looking at the theme code and seeing that it has style info for these controls. Am I missing something?

    I did the following in the App.xaml.cs constructor:

    StyleManager.ApplicationTheme = new Expression_DarkTheme();


    Thanks,
    Ron
  2. Vanya Pavlova
    Admin
    Vanya Pavlova avatar
    2019 posts

    Posted 28 Sep 2011 Link to this post

    Hi Ron,

     

    This behavior is the expected one - when you set an application theme only our RadControls/Silverlight will pick their style for the corresponding theme. The native Silverlight controls will remain with the default one.
    You will have theme support for native Silverlight controls only when you set the theme on a control level:

    <telerik:RadGridView  telerik:StyleManager.Theme="Metro" .../>

    As a kind of workaround you may set the app theme for native Silverlight controls, when using Application theme, as shown below:

    App.xaml.cs:

    StyleManager.SetBasedOn(((Style)Current.Resources[typeof(CheckBox)]), StyleManager.ApplicationTheme);
      
    StyleManager.SetBasedOn(((Style)Current.Resources[typeof(RadioButton)]), StyleManager.ApplicationTheme);
    //...the rest controls in your app

    App.xaml:

    <Style TargetType="CheckBox"/>
    <Style TargetType="RadioButton"/>


    Best wishes,
    Vanya Pavlova
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  3. Ron
    Ron avatar
    9 posts
    Member since:
    Jul 2011

    Posted 28 Sep 2011 Link to this post

    Thanks Vanya.

    Is there any way to have the styles for the native Silverlight controls in a separate assembly so they are compiled? If so, would you happen to have a sample solution that demonstrates how to do it?

    Ron
Back to Top