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

Implicit Style Radial Ranges

1 Answer 60 Views
Gauges
This is a migrated thread and some comments may be shown as answers.
Marc
Top achievements
Rank 1
Marc asked on 21 May 2013, 02:57 PM
I have a solution where I am using the implicit themes and have a pallete switchers similar to what your Executive Dashboard is using. I have set up different gauge properties to switch when I click the theme toggle button. But i can not get the GaugeRange backgrounds to change. In fact they don't even display. Here is some sample code

<telerik:RadialScale x:Name="innerChannelRadialScale" Min="0" Max="300" Radius="0.68" MajorTicks="10" MinorTicks="5" LabelRotationMode="None"
FontWeight="Bold" FontSize="60" SweepAngle="359" StartAngle="90" ShowLastLabel="True" ShowFirstLabel="False"
MajorTickBackground="{DynamicResource MajorTickBackground}"
MiddleTickBackground="{DynamicResource MiddleTickBackground}"
MinorTickBackground="{DynamicResource MinorTickBackground}">
<telerik:RadialScale.Ranges>
       <telerik:GaugeRange x:Name="innerAlarmLowRange" Min="0" Max="50" StartWidth="0.04" EndWidth="0.01" Background="{DynamicResource AlertRangeBackground}" />
       <telerik:GaugeRange x:Name="innerNormalRange" Min="50" Max="250" StartWidth="0.01" EndWidth="0.01" Background="{DynamicResource NormalRangeBackground}" />
       <telerik:GaugeRange x:Name="innerAlarmHighRange" Min="250" Max="300" StartWidth="0.01" EndWidth="0.03" Background="#FFE50000" />
  </telerik:RadialScale.Ranges>

You will see I have set up DynamicResources for all of the Tick Backgrounds and they work perfectly. But the GaugeRange backgrounds do not work at all. In fact they do not show up at all. Is there something special I need to do to set DynamicResources on these?

1 Answer, 1 is accepted

Sort by
0
Andrey
Telerik team
answered on 22 May 2013, 01:34 PM
Hello Marc,

The GaugeRange is a data object (not a framework element). As it is stated in the MSDN (http://msdn.microsoft.com/en-us/library/ms750613.aspx): dynamic resource references have some notable restrictions. At least one of the following must be true:
  • The property being set must be a property on a FrameworkElement or FrameworkContentElement. That property must be backed by a DependencyProperty.
  • The reference is for a value within a Style Setter.
  • The property being set must be a property on a Freezable that is provided as a value of either a FrameworkElement or FrameworkContentElement property, or a Setter value.

So the Dynamic Resources can’t be used on the GaugeRange objects.

Regards,
Andrey Murzov
Telerik

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
Gauges
Asked by
Marc
Top achievements
Rank 1
Answers by
Andrey
Telerik team
Share this question
or