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

How to set the background color consistent with current theme

14 Answers 1091 Views
Window
This is a migrated thread and some comments may be shown as answers.
Ivano
Top achievements
Rank 1
Ivano asked on 21 Sep 2010, 12:24 PM
Hi

I'm trying to set the background color of a Grid (LayoutRoot) of a RadWindow consitent with application theme (that could be changed); RadWindow has alway a white background color despite any ApplicationTheme I could set.
Currently I'm adding a dummy element

<telerik:RadMenu Name="radMenu" Visibility="Collapsed" Width="0" Height="0"/>

and copy color from radMenu.

layoutRoot.Background = radMenu.Background;

Is there a better way to do that?

Thanks
Ivano

14 Answers, 1 is accepted

Sort by
0
Konstantina
Telerik team
answered on 22 Sep 2010, 07:52 AM
Hello Ivano,

Thank you for contacting us.

Unfortunately, the Background of the Window is hard-coded, and you can change it only though editing the style of the Window. The work around you are using is pretty good.
We will consider changing the behaviour of the Background property of the Window in one of our future releases.

If you have any other questions please let us know.

Sincerely yours,
Konstantina
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
Ivano
Top achievements
Rank 1
answered on 23 Sep 2010, 04:22 PM
Hi

I've encountered same issue with RadTreeView and perhaps there are more controls (both your or standard) suffering that.
My feeling is that developing a consistent WPF application, where theme could change, may need a way to get some default (for background, foreground, etc..) from current theme.
My suggestion is to extend StyleManager (or whatever you consider appropriate) providing properties like:
- StyleManager.CurrentTheme.DefaultBackground,
- StyleManager.CurrentTheme.DefaultForeground,
- ....

Sincerely
Ivano



0
Accepted
Pana
Telerik team
answered on 28 Sep 2010, 11:48 AM
Hello Ivano,

We have had the idea of creating something like 'System-Colors' object that can provide some of the brushes used in the current theme. We have not implemented yet one though. As such requests occur once in a while we will consider such solution but we do not have plans to do it in the near future. Thank you for your feedback.

Regards,
Panayot
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
Jaroslav Půbal
Top achievements
Rank 1
answered on 01 Dec 2010, 12:12 AM
+1
I need this too. Now I do some dirty hacks to get current theme consistent background.
0
Sathish
Top achievements
Rank 1
answered on 16 Dec 2011, 06:58 PM
I need this too..

I want to apply a the skin background to an aspx panel.

My requirement is that I want to create a header bar like an empty radmenu with itemtemplate, but without the overhead. I just want the panel to look like a skinned bar.. for that I need a skin manager which will get me the background images and colors
0
Yana
Telerik team
answered on 20 Dec 2011, 10:06 AM
Hello,

Thank you for sending your feedback.

Best wishes,
Yana
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Robert
Top achievements
Rank 1
answered on 29 Mar 2012, 12:55 AM
+1 me also.
0
Vikash
Top achievements
Rank 1
answered on 22 Jun 2012, 07:19 AM
Hello Telerik Team,

Can you explain or send me a sample project how to change wpf grid background appearance according to the theme which i have selected.
0
Thilo
Top achievements
Rank 1
Iron
answered on 10 Dec 2012, 03:46 PM
Hello Telerik Team,

Any News on this Topic ?
Is there a solution in sight?
0
Yana
Telerik team
answered on 13 Dec 2012, 10:12 AM
Hi Thilo,

Using Windows8 theme ( it is called Metro in the older versions of the controls) you could achieve the needed approach. Please check this help article where the approach is explained in more details  (just replace MetroColors with Windows8Colors).

Kind regards,
Yana
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Benjamin
Top achievements
Rank 1
answered on 21 Feb 2013, 07:03 PM
Hello,

Can we have the same for other themes ? Could you create a TelerikColors class independant from theme ? I want to allow the user to select the theme and I want to keep my UI consistent.

Thank you for your great Job ! ;)
0
Yana
Telerik team
answered on 22 Feb 2013, 09:31 AM
Hello Benjamin,

This approach can be used only with Windows8 and Windows8Touch themes.

Kind regards,
Yana
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Benjamin
Top achievements
Rank 1
answered on 24 Feb 2013, 08:31 PM
Hello Yana,

Ok, but does you plan to implement it ?

Thanks
0
Yana
Telerik team
answered on 25 Feb 2013, 11:47 AM
Hello Benjamin,

These themes (Windows8 and Windows8Touch) are designed from the beginning to work like this. Unfortunately the other themes cannot be changed now as this will introduce a breaking change in them.

Thank you for the understanding.

All the best,
Yana
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
Window
Asked by
Ivano
Top achievements
Rank 1
Answers by
Konstantina
Telerik team
Ivano
Top achievements
Rank 1
Pana
Telerik team
Jaroslav Půbal
Top achievements
Rank 1
Sathish
Top achievements
Rank 1
Yana
Telerik team
Robert
Top achievements
Rank 1
Vikash
Top achievements
Rank 1
Thilo
Top achievements
Rank 1
Iron
Benjamin
Top achievements
Rank 1
Share this question
or