Themes compatability

6 posts, 1 answers
  1. Gonzalo
    Gonzalo avatar
    76 posts
    Member since:
    Oct 2012

    Posted 12 May 2011 Link to this post

    Are silverlight 4 themes compatible with telerik controls and viceversa?

    Thanks

    Gonzalo
  2. Answer
    Dani
    Admin
    Dani avatar
    848 posts

    Posted 16 May 2011 Link to this post

    Hi Gonzalo,

    You cannot use MS Silverlight 4 themes on RadControls. RadControls have their own theming mechanism and can be themed with the eight themes that are shipped with the suite only. However, we have taken into consideration the need of consistency between RadControls and native MS controls - we provide styles for the following MS Silverlight (and WPF) controls: LisTBox, TextBox, ScrollViewer, RadioButton, CheckBox. You can theme these controls with each of the eight Telerik themes in the usual manner:

    <ListBox telerik:StyleManager.Theme="Summer" Width="200">
       <ListBoxItem>item 1</ListBoxItem>
    </ListBox>

    I hope this helps.

    Greetings,
    Dani
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Dan
    Dan avatar
    7 posts
    Member since:
    May 2011

    Posted 06 Oct 2011 Link to this post

    How can telerik themes be applied globally to every Silverlight standard control (textbox, listbox, checkbox etc.) in an application? Can it be done as in WPF with Styles in a resource dictionary? I attempted to apply this WPF example to Silverlight: http://www.telerik.com/community/forums/wpf/general-discussions/wpf-theme.aspx but compilation failed on 
    telerik:ThemeResourceKey
    
    Thanks in advance.
  4. Dani
    Admin
    Dani avatar
    848 posts

    Posted 11 Oct 2011 Link to this post

    Hi Dan,

    Telerik themes can be applied to MS controls via the usual syntax. For example:

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

    You do not need any special method to apply Telerik themes to MS controls in Silverlight. If you wish to have the theme global, you can set an ApplicationTheme:

    StyleManager.ApplicationTheme = new VistaTheme();
    InitializeComponent();

    The example you posted refers to the case when you wish to have both a theme and a Style applied to a control. Basically a Style would override the theme unless you base the style on the theme. In WPF this approach works well, but in SIlverlight it is not as reliable.

    I hope this will be helpful.

    Kind regards,
    Dani
    the Telerik team
    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
  5. Dan
    Dan avatar
    7 posts
    Member since:
    May 2011

    Posted 11 Oct 2011 Link to this post

    I'm confused. Do I need to mark every MS checkbox in my application with  telerik:StyleManager.Theme="Metro"? Currently I apply the theme globally to all Rad controls with the line <telerik:MetroTheme x:Key="theme" IsApplicationTheme="True" />
    in App.xaml. Does that single app.xaml line also apply the theme application-wide to MS controls? If not, is there a way to apply the Metro theme globally to all checkbox controls? If so, how?
  6. Dani
    Admin
    Dani avatar
    848 posts

    Posted 12 Oct 2011 Link to this post

    Hello Dan,

    I am sorry if given information was puzzling or misleading for you.

    Basically, yes, you would need to set the theme to each CheckBox in your applciation. To avoid doing that, you could have an implicit style in App.xaml that, as mentioned earlier, you can base on an existing Telerik theme.

    So, for a CheckBox, for example, you can have in App.xaml:
    <Style TargetType="CheckBox" telerik:StyleManager.BasedOn="Metro" />

    And for all RadControls, the ApplicationTheme will be working well:
    public App()
          {
              this.Startup += this.Application_Startup;
              this.Exit += this.Application_Exit;
              this.UnhandledException += this.Application_UnhandledException;
              StyleManager.ApplicationTheme = new MetroTheme();
              InitializeComponent();
          }

    I hope this information will give you a solution.


    Greetings,
    Dani
    the Telerik team
    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
Back to Top