This is a migrated thread and some comments may be shown as answers.

Themes compatability

5 Answers 142 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Gonzalo
Top achievements
Rank 2
Gonzalo asked on 12 May 2011, 04:33 PM
Are silverlight 4 themes compatible with telerik controls and viceversa?

Thanks

Gonzalo

5 Answers, 1 is accepted

Sort by
0
Accepted
Dani
Telerik team
answered on 16 May 2011, 08:02 AM
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
0
Dan
Top achievements
Rank 1
answered on 06 Oct 2011, 04:13 PM
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.
0
Dani
Telerik team
answered on 11 Oct 2011, 04:25 PM
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 >>
0
Dan
Top achievements
Rank 1
answered on 11 Oct 2011, 04:45 PM
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?
0
Dani
Telerik team
answered on 12 Oct 2011, 07:58 AM
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 >>
Tags
General Discussions
Asked by
Gonzalo
Top achievements
Rank 2
Answers by
Dani
Telerik team
Dan
Top achievements
Rank 1
Share this question
or