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

Implicit style temperature guage

2 Answers 92 Views
Gauges
This is a migrated thread and some comments may be shown as answers.
Marc
Top achievements
Rank 1
Marc asked on 14 Mar 2013, 08:33 PM
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 Answers, 1 is accepted

Sort by
0
Andrey
Telerik team
answered on 19 Mar 2013, 09:21 AM

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.

0
Marc
Top achievements
Rank 1
answered on 20 Mar 2013, 08:47 PM
Path option worked great. Thank you!
Tags
Gauges
Asked by
Marc
Top achievements
Rank 1
Answers by
Andrey
Telerik team
Marc
Top achievements
Rank 1
Share this question
or