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

Utilizing Telerik Theme Resources

4 Answers 361 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
rick adams
Top achievements
Rank 2
rick adams asked on 24 Mar 2011, 06:55 PM
is it possible to utilize any of the Telerik Theme resources and apply them to non-Telerik framework elements so that backgrounds, borders etc can have their various parameters set using Telerik Theme resources. I am trying to create a container that would have a border and background that will change appearance based on the Telerik Theme that is selected. Is this possible?

Thanks

Rick Adams

4 Answers, 1 is accepted

Sort by
0
Vladimir Zagorski
Telerik team
answered on 27 Mar 2011, 06:08 PM
Hello Rick ,

All of the themes we shipped come with a build-in styles for some of the standard Microsoft's controls like Button, Slider,  Progressbar, TextBox etc.  In order to apply these styles you will have to explicitly set the telerik:StyleManager.Theme property on the controls as follows:

<Button  telerik:StyleManager.Theme="Windows7" />

In order to change the background of the border when a theme changed  you can use the ThemeAwareBackgroundBehavior available in the Telerik.Windows.Controls assembly:

xmlns:telerikQuickStart="clr-namespace:Telerik.Windows.Controls.QuickStart;assembly=Telerik.Windows.Controls"

<Border   telerikQuickStart:ThemeAwareBackgroundBehavior.IsEnabled="True" />

Let me know if I can be of any further assistance.

Regards,
Vladimir Zagorski
the Telerik team
0
Heidi
Top achievements
Rank 1
answered on 29 Jun 2011, 09:26 AM
Hello,
Recently I replied to a question which were similar to this one.

I ran into this 'telerikQuickStart:ThemeAwareBackgroundBehavior.IsEnabled="True"' a few times, and as I understand from this topic, this might be the solution for me.

If I, for example, create a grid (which is inside my theme container), and add this ^^ property, will it adapt the background color of my Telerik controls in that theme container?

Edit: first trial does not work as expected.
When I only set this background-aware property, the background stays white, while the background of i.e. the Ribbon is dark gray (Summer theme). I can set it manually, and expect it to be overwritten when the theme changes, but I thought it would have been set initially.
0
Vladimir Zagorski
Telerik team
answered on 29 Jun 2011, 05:06 PM
Hello Heidi,

The main purpose of the ThemeAwareBackgroundBehavior is to update the background of the theming container (Border, Grid or any other Framework element containing Telerik controls)  when the application theme changes. For example, the Transparent theme requires an image as a background for better appearance (see this demo for more details). In this demo you can notice that the background changes only for the ExpressionDark and Transparent themes.

For all the other themes you might consider setting the background manually in code or using converter. Another option is to extend the behavior so it has effect on the other themes (check the attached sample).

Hope that helps!


All the best,
Vladimir
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
Murray
Top achievements
Rank 2
answered on 16 Jan 2012, 06:48 PM
Great tip Vladimir, however I con only get it to work on a Border. Are you sure it should work on a Grid?
Tags
General Discussions
Asked by
rick adams
Top achievements
Rank 2
Answers by
Vladimir Zagorski
Telerik team
Heidi
Top achievements
Rank 1
Murray
Top achievements
Rank 2
Share this question
or