Do compiled bindings work with together with Converter ?

GiorgiGiorgi USMember ✭✭

I have listview and tried to change from classic binding to compiled binding. One of the labels uses Converter to convert bool to color of the label text but it crashes with the following exception:

System.NullReferenceException: Object reference not set to an instance of an object
TypedBinding`2[TSource,TProperty].ApplyCore (System.Object sourceObject, Xamarin.Forms.BindableObject target, Xamarin.Forms.BindableProperty property, System.Boolean fromTarget)
TypedBinding`2[TSource,TProperty].Apply (System.Object context, Xamarin.Forms.BindableObject bindObj, Xamarin.Forms.BindableProperty targetProperty, System.Boolean fromBindingContextChanged)
BindableObject.ApplyBindings (System.Boolean skipBindingContext, System.Boolean fromBindingContextChanged)
BindableObject.SetInheritedBindingContext (Xamarin.Forms.BindableObject bindable, System.Object value)
Element.SetChildInheritedBindingContext (Xamarin.Forms.Element child, System.Object context)
Element.b__74_0 (Xamarin.Forms.BindableObject child, System.Object bc)
BindableObjectExtensions.PropagateBindingContext[T] (Xamarin.Forms.BindableObject self, System.Collections.Generic.IList`1[T] children, System.Action`2[T1,T2] setChildBindingContext)
Element.OnBindingContextChanged ()
View.OnBindingContextChanged ()
BindableObject.BindingContextPropertyChanged (Xamarin.Forms.BindableObject bindable, System.Object oldvalue, System.Object newvalue)
BindableObject.SetValueActual (Xamarin.Forms.BindableProperty property, Xamarin.Forms.BindableObject+BindablePropertyContext context, System.Object value, System.Boolean currentlyApplying, Xamarin.Forms.Internals.SetValueFlags attributes, System.Boolean silent)
BindableObject.SetValueCore (Xamarin.Forms.BindableProperty property, System.Object value, Xamarin.Forms.Internals.SetValueFlags attributes, Xamarin.Forms.BindableObject+SetValuePrivateFlags privateAttributes)
BindableObject.SetValue (Xamarin.Forms.BindableProperty property, System.Object value, System.Boolean fromStyle, System.Boolean checkAccess)
BindableObject.SetValue (Xamarin.Forms.BindableProperty property, System.Object value)
BindableObject.set_BindingContext (System.Object value)

So does it mean that compiled binding do not work with bindings that have converter or is it some kind of bug ?

Answers

  • JarvanJarvan Member, Xamarin Team Xamurai
    edited March 12

    Refer to the link , you‘ll see that compiled bindings can work with together with Converter.
    Maybe exist a Static Resource which has nothing in it. Or it cannot be found.

Sign In or Register to comment.