Hi,
I tried to bind the SfLinearGauge Ranges with no success. Ranges is a public ViewModel property of type LinearRangeCollection which is populated programmatically.
This is a simplified version of what I tried:
<syncfusion:SfLinearGauge>
<syncfusion:SfLinearGauge.MainScale>
<syncfusion:LinearScale Minimum="0" Maximum="1000" Ranges="{Binding Ranges}"/>
</syncfusion:SfLinearGauge.MainScale>
</syncfusion:SfLinearGauge>
public LinearRangeCollection Ranges
{
get
{
return new LinearRangeCollection()
{
new LinearRange() { StartValue=0, EndValue=100, RangeStroke=new SolidColorBrush(Colors.Green) },
new LinearRange() { StartValue=100, EndValue=300, RangeStroke=new SolidColorBrush(Colors.Blue) }
};
}
}
I already get a NullReferenceException in the XAML designer:
bei Syncfusion.UI.Xaml.Gauges.LinearScale.ResetRanges()
bei Syncfusion.UI.Xaml.Gauges.LinearScale.Refresh()
bei Syncfusion.UI.Xaml.Gauges.SfLinearGauge.MeasureOverride(Size availableSize)
bei System.Windows.FrameworkElement.MeasureCore(Size availableSize)
...
Is this not supported or am I doing something wrong?
Regards
Bernd