Utilizing Telerik Theme Resources

5 posts, 0 answers
  1. rick adams
    rick adams avatar
    5 posts
    Member since:
    Mar 2010

    Posted 24 Mar 2011 Link to this post

    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
  2. Vladimir Zagorski
    Admin
    Vladimir Zagorski avatar
    15 posts

    Posted 27 Mar 2011 Link to this post

    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
  3. DevCraft banner
  4. Heidi
    Heidi avatar
    6 posts
    Member since:
    Mar 2011

    Posted 29 Jun 2011 Link to this post

    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.
  5. Vladimir Zagorski
    Admin
    Vladimir Zagorski avatar
    15 posts

    Posted 29 Jun 2011 Link to this post

    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
  6. Murray
    Murray avatar
    121 posts
    Member since:
    Aug 2010

    Posted 16 Jan 2012 Link to this post

    Great tip Vladimir, however I con only get it to work on a Border. Are you sure it should work on a Grid?
Back to Top
DevCraft banner