Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 91519

XF with Mvvm - dumb question on debugging

$
0
0

I have an admittedly dumb issue that I am stuck on. I have a property that is being set from a picker in my UI in XF. When the value is set by the user, the setter is called. The setter has the following line:
Item.PrimaryTechnicianGUID = ((value != null) ? value.ItemGUID : Guid.Empty);
The value is not null. The ItemGUID is a valid guid. The Item object is not null. The Item.PrimaryTechnicianGUID is a Guid.Empty. Nothing seems to be a null in the line or anywhere else in the setter. When I attempt to set the Item.PrimaryTechnicianGUID property, I get a null exception when i set the value. it appears that the .ItemGUID is valid. The .PrimaryTechnicianGUID property just has a simple get; set; on it. My debugging foo with Mvvm is weak, so I thought I would see if anyone has a suggestion. I've been stuck on this for a few hours. Thanks for any ideas you have.

The error that I get in the Vs output window is below. There is a lot more, I just tried to put what is appropriate.

07-17 17:48:18.731 I/MonoDroid( 3730): UNHANDLED EXCEPTION:
07-17 17:48:18.747 I/MonoDroid( 3730): System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NullReferenceException: Object reference not set to an instance of an object
07-17 17:48:18.747 I/MonoDroid( 3730): at AppXForms.BaseServiceEventViewModel.set_PrimaryTechnician (AppXForms.ListItemOption value) [0x00033] in c:\Users\wallym\Documents\GitHub\trakref\AppXForms\AppXForms\ViewModels\BaseServiceEventViewModel.cs:69
07-17 17:48:18.747 I/MonoDroid( 3730): at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
07-17 17:48:18.747 I/MonoDroid( 3730): at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00044] in :0
07-17 17:48:18.747 I/MonoDroid( 3730): --- End of inner exception stack trace ---
07-17 17:48:18.747 I/MonoDroid( 3730): at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00062] in :0
07-17 17:48:18.747 I/MonoDroid( 3730): at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in :0
07-17 17:48:18.747 I/MonoDroid( 3730): at Xamarin.Forms.BindingExpression.ApplyCore (System.Object sourceObject, Xamarin.Forms.BindableObject target, Xamarin.Forms.BindableProperty property, Boolean fromTarget) [0x00289] in :0
07-17 17:48:18.747 I/MonoDroid( 3730): at Xamarin.Forms.BindingExpression.Apply (Boolean fromTarget) [0x00037] in :0
07-17 17:48:18.751 I/MonoDroid( 3730): at Xamarin.Forms.Binding.Apply (Boolean fromTarget) [0x00020] in :0
07-17 17:48:18.751 I/MonoDroid( 3730): at Xamarin.Forms.BindableObject.SetValueActual (Xamarin.Forms.BindableProperty property, Xamarin.Forms.BindablePropertyContext context, System.Object value, Boolean currentlyApplying, SetValueFlags attributes, Boolean silent) [0x000e9] in :0
07-17 17:48:18.751 I/MonoDroid( 3730): at Xamarin.Forms.BindableObject.SetValueCore (Xamarin.Forms.BindableProperty property, System.Object value, SetValueFlags attributes, SetValuePrivateFlags privateAttributes) [0x00235] in :0
07-17 17:48:18.751 I/MonoDroid( 3730): at Xamarin.Forms.BindableObject.SetValueCore (Xamarin.Forms.BindableProperty property, System.Object value, SetValueFlags attributes) [0x00000] in :0
07-17 17:48:18.751 I/MonoDroid( 3730): at Xamarin.Forms.BindingExpression.ApplyCore (System.Object sourceObject, Xamarin.Forms.BindableObject target, Xamarin.Forms.BindableProperty property, Boolean fromTarget) [0x001c3] in :0
07-17 17:48:18.751 I/MonoDroid( 3730): at Xamarin.Forms.BindingExpression.Apply (System.Object sourceObject, Xamarin.Forms.BindableObject target, Xamarin.Forms.BindableProperty property) [0x00079] in :0
07-17 17:48:18.751 I/MonoDroid( 3730): at Xamarin.Forms.Binding.Apply (System.Object newContext, Xamarin.Forms.BindableObject bindObj, Xamarin.Forms.BindableProperty targetProperty) [0x00055] in :0
An unhandled exception occured.

PS. I'm the dumb guy over in the corner with the dunce hat.


Viewing all articles
Browse latest Browse all 91519

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>