How to set the background color consistent with current theme

15 posts, 1 answers
  1. Ivano
    Ivano avatar
    39 posts
    Member since:
    Feb 2009

    Posted 21 Sep 2010 Link to this post

    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
  2. Konstantina
    Admin
    Konstantina avatar
    2332 posts

    Posted 22 Sep 2010 Link to this post

    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
  3. UI for WPF is Visual Studio 2017 Ready
  4. Ivano
    Ivano avatar
    39 posts
    Member since:
    Feb 2009

    Posted 23 Sep 2010 Link to this post

    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



  5. Answer
    Pana
    Admin
    Pana avatar
    748 posts

    Posted 28 Sep 2010 Link to this post

    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
  6. Jaroslav Půbal
    Jaroslav Půbal avatar
    52 posts
    Member since:
    Dec 2009

    Posted 30 Nov 2010 Link to this post

    +1
    I need this too. Now I do some dirty hacks to get current theme consistent background.
  7. Sathish
    Sathish avatar
    15 posts
    Member since:
    Dec 2010

    Posted 16 Dec 2011 Link to this post

    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
  8. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 20 Dec 2011 Link to this post

    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 >>

  9. Robert
    Robert avatar
    271 posts
    Member since:
    Mar 2011

    Posted 28 Mar 2012 Link to this post

    +1 me also.
  10. Vikash
    Vikash avatar
    12 posts
    Member since:
    Apr 2012

    Posted 22 Jun 2012 Link to this post

    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.
  11. Thilo
    Thilo avatar
    26 posts
    Member since:
    Feb 2011

    Posted 10 Dec 2012 Link to this post

    Hello Telerik Team,

    Any News on this Topic ?
    Is there a solution in sight?
  12. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 13 Dec 2012 Link to this post

    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.

  13. Benjamin
    Benjamin avatar
    24 posts
    Member since:
    Dec 2012

    Posted 21 Feb 2013 Link to this post

    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 ! ;)
  14. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 22 Feb 2013 Link to this post

    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.

  15. Benjamin
    Benjamin avatar
    24 posts
    Member since:
    Dec 2012

    Posted 24 Feb 2013 Link to this post

    Hello Yana,

    Ok, but does you plan to implement it ?

    Thanks
  16. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 25 Feb 2013 Link to this post

    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.

Back to Top
UI for WPF is Visual Studio 2017 Ready