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

Theme maintenance

3 Answers 19 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
A
Top achievements
Rank 1
A asked on 04 Mar 2014, 06:25 AM
Hi,

We are using Telerik controls (2012.3.1129.40) and use theme support. Everything is working fine - user can select theme to use and appearance of application will change, but there are 2 scenarios that cause us headache.

Usecase 1:
I've changed style of control, for example FilteringControl of the RadGridView. In fact I needed small change in layout, so I changed template for the control, but because layout and appearance options in themes are mixed colors are redefined to. Using 'StyleManager.Theme="{x:Static StyleManager.ApplicationTheme}"' trick I can make some parts of the control to look consistent (buttons, listboxes) with other application parts, but there are things like backgroung/border colors defined in the template, that should be changed according to the theme. So from now on, whenever theme is changed FilteringControls look is inconsistent. I could redefine template for all other themes (just to change 3-5 color properties), but how can I specify which template should be used for which theme?

Usecase 2:
We have custom controls, that should match in theme with the rest of application. I accept to 'copy-paste' whole template for another theme just to change 2-3 color properties, but again how can I tell to theme manager which template should be used according to the selected theme?

Thank you


3 Answers, 1 is accepted

Sort by
0
Masha
Telerik team
answered on 07 Mar 2014, 10:28 AM
Hello,

It is not a good idea to use StyleManager to switching themes at runtime. When trying to switch an application theme through the StyleManager, RadControls pick up their theme once when they are created. After layout is created the application theme cannot be changed. To force the controls to change their theme, you need to reset or recreate the UI, so that the controls can pick up the new theme. This is the reason why with this approach you need to recreate your view.

And this is why we strongly recommend using the implicit styling approach when you switching themes. This way you will have no problems to point which template to be used  when the theme is changed.

I hope this information would be helpful.

Regards,
Masha
Telerik

DevCraft Q1'14 is here! Watch the online conference to see how this release solves your top-5 .NET challenges. Watch on demand now.

0
A
Top achievements
Rank 1
answered on 07 Mar 2014, 01:56 PM
Thank you for the reply,

I guess using 'implicit styling' solves second issue - for each theme I will just create 'skins' for my control and will be adding 'skins' according to the style selected.

What about 1st usecase - even with 'implicit styling' I have to modify 'skin's of FilteringControl for all themes, which quite tedious and laborious. My goal was just to 'tweak' layout of the control. What is the 'best-practice' for this scenario.
0
Vanya Pavlova
Telerik team
answered on 12 Mar 2014, 08:33 AM
Hello,


Thank you for getting back to us! The styles used in our themes are theme specific. This means that you have a separate style for each theme. FilteringControl is not different than the rest elements and components, as part of the suite. Even if you want to switch FilteringControl's style using StyleManager or Implicit styles you should have a separate modified style for each theme.  


Regards,
Vanya Pavlova
Telerik
 

DevCraft Q1'14 is here! Watch the online conference to see how this release solves your top-5 .NET challenges. Watch on demand now.

 
Tags
General Discussions
Asked by
A
Top achievements
Rank 1
Answers by
Masha
Telerik team
A
Top achievements
Rank 1
Vanya Pavlova
Telerik team
Share this question
or