Hi there,
I'm trying to display a range series that is defined by a collection and a gap.
The ObservableCollection is defining the upper limit. The lower limit is defined by the upper limit minus the gap.
For this display I want to use a value converter that returns the lower limit for each upper limit.
<
telerik:RadCartesianChart
>
<
telerik:RadCartesianChart.HorizontalAxis
>
<
telerik:CategoricalAxis
/>
</
telerik:RadCartesianChart.HorizontalAxis
>
<
telerik:RadCartesianChart.VerticalAxis
>
<
telerik:LinearAxis
/>
</
telerik:RadCartesianChart.VerticalAxis
>
<
telerik:RadCartesianChart.Series
>
<
telerik:RangeSeries
ItemsSource
=
"{Binding Path=SensorParameter.Range_UpperLimit}"
HighBinding
=
"Range_UpperLimit"
CategoryBinding
=
"RPM"
>
<
telerik:RangeSeries.LowBinding
>
<
MultiBinding
Converter
=
"{StaticResource ConvertOKLowValue}"
>
<
Binding
Path
=
"Range_UpperLimit"
/>
<
Binding
Path
=
"Range_Gap"
/>
</
MultiBinding
>
</
telerik:RangeSeries.LowBinding
>
</
telerik:RangeSeries
>
</
telerik:RadCartesianChart.Series
>
</
telerik:RadCartesianChart
>
The SensorParameter struct looks like this:
01.
public
class
RPM_Range : ObservableObject
02.
{
03.
public
float
Range_Gap {
get
;
set
; }
04.
public
ObservableCollection<Range_Limit> Range_UpperLimit {
get
;
set
; }
05.
}
06.
07.
public
class
Range_Limit: ObservableObject
08.
{
09.
public
float
RPM
10.
{
11.
get
;
set
;
12.
}
13.
14.
public
float
OK_Range_UpperLimit
15.
{
16.
get
;
set
;
17.
}
18.
}
The value converter is implemented like this:
01.
public
class
RangeSeriesLowConverter : IMultiValueConverter
02.
{
03.
public
object
Convert(
object
[] values, Type targetType,
object
parameter, CultureInfo culture)
04.
{
05.
double
? _RangeUpperLimit = values[0]
as
double
?;
06.
double
? _RangeGap = values[1]
as
double
?;
07.
if
(_RangeUpperLimit - _RangeGap < 0)
08.
return
0;
09.
return
_RangeUpperLimit - _RangeGap;
10.
}
11.
12.
public
object
[] ConvertBack(
object
value, Type[] targetTypes,
object
parameter, CultureInfo culture)
13.
{
14.
throw
new
NotImplementedException();
15.
}
16.
}
UpperLimit binds correctly. But I'm not getting the binding to the lower limit correctly. While debugging the value converter is called, but the arguments are not passed correctly.
Is there a restriction using value converters for the low binding?
Thanks in advance for your help.
Kindly
Philipp