Ranges binding

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

1 Reply

AK Ashwin Kumaravel Syncfusion Team September 14, 2017 10:54 AM UTC

Hi Bernd,

Thanks for using Syncfusion products,

We could reproduce the reported issue “Getting NullReference Exception when binding Ranges” at our end. And we have logged a defect report regarding the same. A support incident to track the status of this defect has been created under your account.

Please log on to our support website to check for further updates.

https://www.syncfusion.com/account/login?ReturnUrl=%2fsupport%2fdirecttrac%2fincidents/  

Regards,
Ashwin K



Loader.
Up arrow icon