Implicit style temperature guage

3 posts, 0 answers
  1. Marc
    Marc avatar
    15 posts
    Member since:
    Oct 2007

    Posted 14 Mar 2013 Link to this post

    The working temperature gauge example provided in the Silverlight/WPF demos uses the Windows 8 theme to style it. I am using a Implicit styles similar to the Executive Dashboard solution. In the Path information to create the "bulb" at the bottom of the temperature gauge there is a call to the Windows 8 Accent Brush:

    Fill="{telerik:Windows8Resource ResourceKey=AccentBrush}"

    I'm not sure what to change this to so that I can dynamically change to any theme. I tried changing it to:

    Fill="{DynamicResource AccentBrush}"

    But this did not work with Expression_Dark.

    Can you help?
  2. Andrey
    Admin
    Andrey avatar
    1681 posts

    Posted 19 Mar 2013 Link to this post

    Hello Marc,

    This brush is designed for other purposes and it cannot be used this way. This is one of the Windows8 and Windows8Touch theme built-in brushes. You can take a look at the following article which demonstrating how to add and use the Windows8 theme brushes in a solution:
    http://www.telerik.com/help/wpf/common-styles-appearance-colorizing-metro-theme.html

    In fact the AccentBrush just is used for the bar indicator in the BarBackground brush in the Windows8 theme. Color for the "bulb" and color for the bar indicator should be the same. So, you can use for the "bulb" the following resources which are implemented in each theme:
    - BarBackground
    - BarStroke
    - BarStrokeThickness
    As another approach you can bind the Background, BorderBrush and StrokeThickness properties of the bar indicator in thermometer to the "bulb" like the following:

    <Path
        Fill="{Binding ElementName=linearBar, Path=Background}"
        Stroke="{Binding ElementName=linearBar, Path=BorderBrush}"
        StrokeThickness="{Binding ElementName=linearBar, Path=StrokeThickness}"
    />

    Regards,
    Andrey Murzov
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. UI for WPF is Visual Studio 2017 Ready
  4. Marc
    Marc avatar
    15 posts
    Member since:
    Oct 2007

    Posted 20 Mar 2013 Link to this post

    Path option worked great. Thank you!
Back to Top