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

ThemeResolutionService ??

1 Answer 479 Views
Themes and Visual Style Builder
This is a migrated thread and some comments may be shown as answers.
Mateo
Top achievements
Rank 1
Mateo asked on 23 Aug 2007, 03:06 PM
I'm trying to figure out how to load and assign theme at runtime. All of your examples are pretty basic and does not demonstrate a complete mechanism. I looked in documentation and code sample about the ThemeResolutionService but found nothing interesting. What is this object supposed to provide?

in my code at program startup i do the following

ThemeResolutionService.RegisterThemeFromStorage(ThemeStorageType.Resource, string.Format("My.Client.Resources.{0}", Properties.Settings.Default.ThemeName));

ThemeResolutionService.ApplicationThemeName = Properties.Settings.Default.ThemeName;

i would think that the actual theme that will be used for the application is the theme registered in ThemeResolutionService.ApplicationThemeName ?

nothing seem's to change. Everything is like a reset. And yes my theme is embedded in resources and well known. When i open it with the theme builder i see it fine too.

Could you please provide just a couple lines of code that
1-register some theme (so user can change later)
2-set's a default theme for the application.
3-use it !

thanks
ps: sorry to mention this but your documentation is way incomplete! and half your sample are to basic or not complete.

1 Answer, 1 is accepted

Sort by
0
Mike
Telerik team
answered on 24 Aug 2007, 03:43 PM
Hello Mateo,

I've prepared an application that demonstrates the usage of ApplicationThemeName property of ThemeResolutionService. Currently if you set this property it will force all RadControls in the application to load the specified theme instead of the theme defined in the ThemeName property of each corresponding control.

With this approach you should have themes for all RadControls that you are using in your app, otherwise they will simply look bad. I believe this is exactly your case. This is also demonstrated in the application attached. I have defined the "CustomTheme" only for the ribbon and button controls, so if you set it to other controls, they would appear grayish.

We understand that creating a new theme for all controls in an application can be a very time consuming task, thus in the future release we will change the behavior of this feature to handle the case when not all control have this theme implemented.

Currently you should either change all control's ThemeName property accordingly or implement the corresponding theme for all radcontrols you will be using in the application.
 

Best wishes,
Mike
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Themes and Visual Style Builder
Asked by
Mateo
Top achievements
Rank 1
Answers by
Mike
Telerik team
Share this question
or