We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Ranges binding

Thread ID:

Created:

Updated:

Platform:

Replies:

132642 Sep 13,2017 03:50 PM UTC Sep 14,2017 10:54 AM UTC WPF 1
loading
Tags: SfLinearGauge
Bernd
Asked On September 13, 2017 03:50 PM UTC

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

Ashwin Kumaravel [Syncfusion]
Replied On 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



CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;