I'm wondering if someone can help me with a problem I have been facing during the evaluation of the SFLinearGauge control. I have the following code that works fine in my xamarin forms android app. <linear:SfLinearGauge x:Name="linearGauge" Scale="1.0" Orientation="OrientationVertical" Grid.Row="0" Grid.Column="2" Grid.RowSpan="2">
I get a Unhandled exception when running using the Visual studio 2015 debugger. when I add a data binding to the Value field as follows <linear:SfLinearGauge x:Name="linearGauge" Scale="1.0" Orientation="OrientationVertical" Grid.Row="0" Grid.Column="2" Grid.RowSpan="2">
04-03 16:15:08.263 I/MonoDroid( 2790): at Xamarin.Forms.BindableObject.SetValueCore (Xamarin.Forms.BindableProperty property, System.Object value, Xamarin.Forms.BindableObject+SetValueFlags attributes, Xamarin.Forms.BindableObject+SetValuePrivateFlags privateAttributes) [0x0014b] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Core\BindableObject.cs:378
04-03 16:15:08.263 I/MonoDroid( 2790): at Xamarin.Forms.BindingExpression.ApplyCore (System.Object sourceObject, Xamarin.Forms.BindableObject target, Xamarin.Forms.BindableProperty property, System.Boolean fromTarget) [0x001f9] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Core\BindingExpression.cs:173
04-03 16:15:08.263 I/MonoDroid( 2790): at Xamarin.Forms.BindingExpression.Apply (System.Boolean fromTarget) [0x0003e] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Core\BindingExpression.cs:55
04-03 16:15:08.263 I/MonoDroid( 2790): at Xamarin.Forms.BindingExpression+BindingExpressionPart.<PropertyChanged>b__47_0 () [0x00000] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Core\BindingExpression.cs:542
04-03 16:15:08.263 I/MonoDroid( 2790): at Java.Lang.Thread+RunnableImplementor.Run () [0x0000b] in /Users/builder/data/lanes/4009/9578cdcd/source/xamarin-android/src/Mono.Android/Java.Lang/Thread.cs:36
04-03 16:15:08.263 I/MonoDroid( 2790): at Java.Lang.IRunnableInvoker.n_Run (System.IntPtr jnienv, System.IntPtr native__this) [0x00009] in /Users/builder/data/lanes/4009/9578cdcd/source/monodroid/src/Mono.Android/platforms/android-25/src/generated/Java.Lang.IRunnable.cs:81
04-03 16:15:08.263 I/MonoDroid( 2790): at (wrapper dynamic-method) System.Object:b199fbca-09af-4706-b3e3-7c0d9643e798 (intptr,intptr)
AKAshwin Kumaravel Syncfusion Team April 5, 2017 06:41 AM UTC
Thank you for using Syncfusion products.
We were unable to reproduce the reported issue “SfLinearGauge Unhandled exception” from your code snippet at our end. We have created a testing sample based on your requirement and can be downloaded from the below location
Since the issue is not reproduced at our end, we would like to know the following details, which will helpful in further analysis and to provide the solution sooner.
- Modify the attached sample to replicate your scenario - Or provide your sample along with replication steps.
DRDon RobbApril 5, 2017 01:45 PM UTC
Thanks for the reply and example. The difference between your example and my code is that I am writing the bindable property over and over again at a rate of about one second with different values. I get the exception for which I posted the stack trace at a random time. It works for awhile and then the exception is thrown. The other difference is my accessor is a double. Is that ok?
PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
AKAshwin Kumaravel Syncfusion Team April 6, 2017 12:50 PM UTC
We have modified our sample based on your code snippet, still we could not able to reproduce the reported issue.We have created a testing sample based on your requirement and can be downloaded from the below location
Can you please modify the attached sample to replicate the issue?
We would like to know the following details from your side, 1)Assembly version, 2)Device configuration-In which you have deployed the sample 3)OS version
DRDon RobbApril 6, 2017 05:35 PM UTC
I have a attached a project that is able to cause the exception. To cause the exception.
1. Use the menu button I have provided to launch the gauge screen.
2. Navigate back to the menu page. and the exception I am seeing will happen.
The code I have provided causes the exception when navigating away from the page that has the gauge. In my app code (not the example I have provided) I do something similar. I navigate back and fourth between the menu and the gauge screen while constantly updating my view model. In my app the exception happens at a random time but in the example I have provided it happens write away when you click the back arrow. I can only assume that your SFLinearGauge module is still updating via the bindable property when the page is navigated away from and it thinks there is an invalid handle or something. Xamarin forms native modules allow you to continue to update your view model even though the page that it is bound too has been navigated away from. SFLinearGauge causes the exception I have posted when the page is navigated away from. I don't think this is correct behaviour.
AKAshwin Kumaravel Syncfusion Team April 7, 2017 05:43 AM UTC
We are deeply regret for the inconvenience caused.
We were able to reproduce the reported issue “SfLinearGauge Unhandled exception” 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.