Hi,
I'm using the new RadRadialGauge (Q3 2011 SP1) to build a user control to visualize a valve. This valve should show a perfectly horizontal line if the valve is completely closed with a value of 0 and a perfectly vertical line if the valve is completely open with a value of 100. If the valve has a value of 50, the line will be a perfect diagonal line pointing north-west to south-east.
I'm created the following user control that works:
with the following code behind:
This successfully renders the top left half of the valve. To render the bottom right half of the value, I change the XAML:
to:
While the user control successfully displays the bottom right half of the valve, when I embed this new user control into a window, I get the following error message:
An Unhandled Exception has occurred
'-INF' is not a valid value for property 'Height'.
at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)
at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
at Telerik.Windows.Controls.Gauge.Needle.Resize() in c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Controls\DataVisualization\Gauge\Indicators\Needle.cs:line 96
at Telerik.Windows.Controls.Gauge.ScaleObject.OnValueChanged(DependencyObject source) in c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Controls\DataVisualization\Gauge\ScaleObject.cs:line 399
at Telerik.Windows.Controls.Gauge.InteractiveIndicator.RefreshIndicator() in c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Controls\DataVisualization\Gauge\Indicators\InteractiveIndicator.cs:line 237
at Telerik.Windows.Controls.Gauge.InteractiveIndicator.OnValueChanged(Double oldValue, Double newValue) in c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Controls\DataVisualization\Gauge\Indicators\InteractiveIndicator.cs:line 190
at Telerik.Windows.Controls.Gauge.GraphicIndicator.InternalValuePropertyChangedHandler(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs eventArgs) in c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Controls\DataVisualization\Gauge\Indicators\GraphicIndicator.cs:line 644
at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)
at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
at Telerik.Windows.Controls.Gauge.IndicatorHelper.RefreshInternalValue(GraphicIndicator indicator, Double value) in c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Controls\DataVisualization\Gauge\Indicators\IndicatorHelper.cs:line 223
at Telerik.Windows.Controls.Gauge.IndicatorHelper.CoerceValueProperty(DependencyObject source, Object value) in c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Controls\DataVisualization\Gauge\Indicators\IndicatorHelper.cs:line 72
at System.Windows.DependencyObject.ProcessCoerceValue(DependencyProperty dp, PropertyMetadata metadata, EntryIndex& entryIndex, Int32& targetIndex, EffectiveValueEntry& newEntry, EffectiveValueEntry& oldEntry, Object& oldValue, Object baseValue, Object controlValue, CoerceValueCallback coerceValueCallback, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, Boolean skipBaseValueChecks)
at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)
at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
at Telerik.Windows.Controls.Gauge.GraphicIndicator.set_Value(Double value) in c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Controls\DataVisualization\Gauge\Indicators\GraphicIndicator.cs:line 385
at AlentControls.ucValve.set_Value(Double value) in C:\Utveckling\Alent\AlentControls\ucValve.xaml.vb:line 19
at AlentControls.ucValve..ctor() in C:\Utveckling\Alent\AlentControls\ucValve.xaml.vb:line 7
If I remove setting the TailHeight property to 1, it works. If I set the TailHeight property to any value, the above unhandled exception occurs.
Am I doing something wrong or is this an issue with the new RadRadialGauge (specifically, the Needle object).
Kind regards,
Dave.
I'm using the new RadRadialGauge (Q3 2011 SP1) to build a user control to visualize a valve. This valve should show a perfectly horizontal line if the valve is completely closed with a value of 0 and a perfectly vertical line if the valve is completely open with a value of 100. If the valve has a value of 50, the line will be a perfect diagonal line pointing north-west to south-east.
I'm created the following user control that works:
<
UserControl
x:Class
=
"ucValve"
xmlns:telerik
=
"http://schemas.telerik.com/2008/xaml/presentation"
d:DesignHeight
=
"48"
d:DesignWidth
=
"48"
mc:Ignorable
=
"d"
>
<
Grid
>
<
telerik:RadRadialGauge
>
<
telerik:RadRadialGauge.InnerBackground
>
<
SolidColorBrush
/>
</
telerik:RadRadialGauge.InnerBackground
>
<
telerik:RadRadialGauge.InnerBorderBrush
>
<
SolidColorBrush
/>
</
telerik:RadRadialGauge.InnerBorderBrush
>
<
telerik:RadRadialGauge.OuterBackground
>
<
SolidColorBrush
/>
</
telerik:RadRadialGauge.OuterBackground
>
<
telerik:RadRadialGauge.OuterBorderBrush
>
<
SolidColorBrush
/>
</
telerik:RadRadialGauge.OuterBorderBrush
>
<
telerik:RadialScale
x:Name
=
"Scale"
MajorTickRelativeHeight
=
"0"
MajorTicks
=
"0"
Max
=
"100"
Min
=
"0"
Radius
=
"1.25"
StartAngle
=
"180"
SweepAngle
=
"90"
>
<
telerik:RadialScale.Indicators
>
<
telerik:Needle
x:Name
=
"Needle"
BorderBrush
=
"Black"
>
<
telerik:Needle.Style
>
<
Style
TargetType
=
"{x:Type telerik:Needle}"
>
<
Setter
Property
=
"telerik:ScaleObject.Location"
Value
=
"Inside"
/>
<
Setter
Property
=
"telerik:ScaleObject.RelativeWidth"
Value
=
"0.05"
/>
</
Style
>
</
telerik:Needle.Style
>
</
telerik:Needle
>
<
telerik:Pinpoint
Background
=
"Black"
BorderThickness
=
"1"
>
<
telerik:Pinpoint.Style
>
<
Style
TargetType
=
"{x:Type telerik:Pinpoint}"
>
<
Setter
Property
=
"telerik:ScaleObject.Location"
Value
=
"Inside"
/>
<
Setter
Property
=
"telerik:ScaleObject.RelativeHeight"
Value
=
"0.2"
/>
<
Setter
Property
=
"telerik:ScaleObject.RelativeWidth"
Value
=
"0.2"
/>
</
Style
>
</
telerik:Pinpoint.Style
>
</
telerik:Pinpoint
>
</
telerik:RadialScale.Indicators
>
<
telerik:RadialScale.LabelTemplate
>
<
DataTemplate
/>
</
telerik:RadialScale.LabelTemplate
>
</
telerik:RadialScale
>
</
telerik:RadRadialGauge
>
</
Grid
>
</
UserControl
>
Imports
System.ComponentModel
Public
Class
ucValve
Public
Sub
New
()
InitializeComponent()
Value = valueDefaultValue
End
Sub
#Region "Properties"
Private
Const
valueDefaultValue
As
Double
= 0
<Category(
"Common"
), DefaultValue(valueDefaultValue)>
Public
Property
Value
As
Double
Get
Return
Needle.Value
End
Get
Set
(
ByVal
value
As
Double
)
Needle.Value = value
End
Set
End
Property
Public
ReadOnly
Property
Maximum
As
Double
Get
Return
Scale.Max
End
Get
End
Property
Public
ReadOnly
Property
Minimum
As
Double
Get
Return
Scale.Min
End
Get
End
Property
#End Region
End
Class
This successfully renders the top left half of the valve. To render the bottom right half of the value, I change the XAML:
<
telerik:Needle
x:Name
=
"Needle"
BorderBrush
=
"Black"
>
<
telerik:Needle
x:Name
=
"Needle"
BorderBrush
=
"Black"
TailHeight
=
"1"
>
While the user control successfully displays the bottom right half of the valve, when I embed this new user control into a window, I get the following error message:
An Unhandled Exception has occurred
'-INF' is not a valid value for property 'Height'.
at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)
at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
at Telerik.Windows.Controls.Gauge.Needle.Resize() in c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Controls\DataVisualization\Gauge\Indicators\Needle.cs:line 96
at Telerik.Windows.Controls.Gauge.ScaleObject.OnValueChanged(DependencyObject source) in c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Controls\DataVisualization\Gauge\ScaleObject.cs:line 399
at Telerik.Windows.Controls.Gauge.InteractiveIndicator.RefreshIndicator() in c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Controls\DataVisualization\Gauge\Indicators\InteractiveIndicator.cs:line 237
at Telerik.Windows.Controls.Gauge.InteractiveIndicator.OnValueChanged(Double oldValue, Double newValue) in c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Controls\DataVisualization\Gauge\Indicators\InteractiveIndicator.cs:line 190
at Telerik.Windows.Controls.Gauge.GraphicIndicator.InternalValuePropertyChangedHandler(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs eventArgs) in c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Controls\DataVisualization\Gauge\Indicators\GraphicIndicator.cs:line 644
at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)
at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
at Telerik.Windows.Controls.Gauge.IndicatorHelper.RefreshInternalValue(GraphicIndicator indicator, Double value) in c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Controls\DataVisualization\Gauge\Indicators\IndicatorHelper.cs:line 223
at Telerik.Windows.Controls.Gauge.IndicatorHelper.CoerceValueProperty(DependencyObject source, Object value) in c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Controls\DataVisualization\Gauge\Indicators\IndicatorHelper.cs:line 72
at System.Windows.DependencyObject.ProcessCoerceValue(DependencyProperty dp, PropertyMetadata metadata, EntryIndex& entryIndex, Int32& targetIndex, EffectiveValueEntry& newEntry, EffectiveValueEntry& oldEntry, Object& oldValue, Object baseValue, Object controlValue, CoerceValueCallback coerceValueCallback, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, Boolean skipBaseValueChecks)
at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)
at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
at Telerik.Windows.Controls.Gauge.GraphicIndicator.set_Value(Double value) in c:\TB\117\WPF_Scrum\Release_WPF\Sources\Development\Controls\DataVisualization\Gauge\Indicators\GraphicIndicator.cs:line 385
at AlentControls.ucValve.set_Value(Double value) in C:\Utveckling\Alent\AlentControls\ucValve.xaml.vb:line 19
at AlentControls.ucValve..ctor() in C:\Utveckling\Alent\AlentControls\ucValve.xaml.vb:line 7
If I remove setting the TailHeight property to 1, it works. If I set the TailHeight property to any value, the above unhandled exception occurs.
Am I doing something wrong or is this an issue with the new RadRadialGauge (specifically, the Needle object).
Kind regards,
Dave.