I recently added a new page with basic SfPicker functionality: a VM data-bound ItemsSource and VM data-bound SelectedIndex, both using the default binding modes. After setting the page BindingContext to the VM and calling InitializeComponent(), the app crashes with the following stack trace:
SelectionController.AssignSelectedItemFromSelectedIndex ()
SfPicker.set_SelectedIndex (System.Object value)
SfPickerMapping.OnPickerPropertiesChanged (System.String propertyName, Syncfusion.SfPicker.XForms.SfPicker formsPicker, Com.Syncfusion.SfPicker.SfPicker nativePicker)
SfPickerRenderer.OnElementPropertyChanged (System.Object sender, System.ComponentModel.PropertyChangedEventArgs e)
(wrapper delegate-invoke) <Module>.invoke_void_object_PropertyChangedEventArgs(object,System.ComponentModel.PropertyChangedEventArgs)
BindableObject.OnPropertyChanged (System.String propertyName) D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:266
Element.OnPropertyChanged (System.String propertyName) D:\a\1\s\Xamarin.Forms.Core\Element.cs:362
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) D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:510
BindableObject.SetValueCore (Xamarin.Forms.BindableProperty property, System.Object value, Xamarin.Forms.Internals.SetValueFlags attributes, Xamarin.Forms.BindableObject+SetValuePrivateFlags privateAttributes) D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:446
TypedBinding`2[TSource,TProperty].ApplyCore (System.Object sourceObject, Xamarin.Forms.BindableObject target, Xamarin.Forms.BindableProperty property, System.Boolean fromTarget) D:\a\1\s\Xamarin.Forms.Core\TypedBinding.cs:233
TypedBinding`2[TSource,TProperty].Apply (System.Object context, Xamarin.Forms.BindableObject bindObj, Xamarin.Forms.BindableProperty targetProperty, System.Boolean fromBindingContextChanged) D:\a\1\s\Xamarin.Forms.Core\TypedBinding.cs:142
BindableObject.ApplyBindings (System.Boolean skipBindingContext, System.Boolean fromBindingContextChanged) D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:530
BindableObject.SetInheritedBindingContext (Xamarin.Forms.BindableObject bindable, System.Object value) D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:246
Element.SetChildInheritedBindingContext (Xamarin.Forms.Element child, System.Object context) D:\a\1\s\Xamarin.Forms.Core\Element.cs:479
TemplatedView.SetChildInheritedBindingContext (Xamarin.Forms.Element child, System.Object context) D:\a\1\s\Xamarin.Forms.Core\TemplatedView.cs:69
Element.<OnBindingContextChanged>b__83_0 (Xamarin.Forms.BindableObject child, System.Object bc) D:\a\1\s\Xamarin.Forms.Core\Element.cs:310
BindableObjectExtensions.PropagateBindingContext[T] (Xamarin.Forms.BindableObject self, System.Collections.Generic.IList`1[T] children, System.Action`2[T1,T2] setChildBindingContext) D:\a\1\s\Xamarin.Forms.Core\BindableObjectExtensions.cs:28
Element.OnBindingContextChanged () D:\a\1\s\Xamarin.Forms.Core\Element.cs:308
VisualElement.OnBindingContextChanged () D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:827
View.OnBindingContextChanged () D:\a\1\s\Xamarin.Forms.Core\View.cs:158
ContentView.OnBindingContextChanged () D:\a\1\s\Xamarin.Forms.Core\ContentView.cs:16
PancakeView.OnBindingContextChanged ()
BindableObject.SetInheritedBindingContext (Xamarin.Forms.BindableObject bindable, System.Object value) D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:247
Element.SetChildInheritedBindingContext (Xamarin.Forms.Element child, System.Object context) D:\a\1\s\Xamarin.Forms.Core\Element.cs:479
Element.<OnBindingContextChanged>b__83_0 (Xamarin.Forms.BindableObject child, System.Object bc) D:\a\1\s\Xamarin.Forms.Core\Element.cs:310
BindableObjectExtensions.PropagateBindingContext[T] (Xamarin.Forms.BindableObject self, System.Collections.Generic.IList`1[T] children, System.Action`2[T1,T2] setChildBindingContext) D:\a\1\s\Xamarin.Forms.Core\BindableObjectExtensions.cs:28
Element.OnBindingContextChanged () D:\a\1\s\Xamarin.Forms.Core\Element.cs:308
VisualElement.OnBindingContextChanged () D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:827
View.OnBindingContextChanged () D:\a\1\s\Xamarin.Forms.Core\View.cs:158
BindableObject.SetInheritedBindingContext (Xamarin.Forms.BindableObject bindable, System.Object value) D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:247
Element.SetChildInheritedBindingContext (Xamarin.Forms.Element child, System.Object context) D:\a\1\s\Xamarin.Forms.Core\Element.cs:479
Element.<OnBindingContextChanged>b__83_0 (Xamarin.Forms.BindableObject child, System.Object bc) D:\a\1\s\Xamarin.Forms.Core\Element.cs:310
BindableObjectExtensions.PropagateBindingContext[T] (Xamarin.Forms.BindableObject self, System.Collections.Generic.IList`1[T] children, System.Action`2[T1,T2] setChildBindingContext) D:\a\1\s\Xamarin.Forms.Core\BindableObjectExtensions.cs:28
Element.OnBindingContextChanged () D:\a\1\s\Xamarin.Forms.Core\Element.cs:308
VisualElement.OnBindingContextChanged () D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:827
View.OnBindingContextChanged () D:\a\1\s\Xamarin.Forms.Core\View.cs:158
Grid.OnBindingContextChanged () D:\a\1\s\Xamarin.Forms.Core\Grid.cs:151
BindableObject.SetInheritedBindingContext (Xamarin.Forms.BindableObject bindable, System.Object value) D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:247
Element.set_Parent (Xamarin.Forms.Element value) D:\a\1\s\Xamarin.Forms.Core\Element.cs:201
Element.OnChildRemoved (Xamarin.Forms.Element child, System.Int32 oldLogicalIndex) D:\a\1\s\Xamarin.Forms.Core\Element.cs:342
VisualElement.OnChildRemoved (Xamarin.Forms.Element child, System.Int32 oldLogicalIndex) D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:843
Layout`1[T].OnChildRemoved (Xamarin.Forms.Element child, System.Int32 oldLogicalIndex) D:\a\1\s\Xamarin.Forms.Core\Layout.cs:33
Layout.OnInternalRemoved (Xamarin.Forms.View view, System.Int32 oldIndex) D:\a\1\s\Xamarin.Forms.Core\Layout.cs:455
Layout.InternalChildrenOnCollectionChanged (System.Object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) D:\a\1\s\Xamarin.Forms.Core\Layout.cs:418
(wrapper delegate-invoke) <Module>.invoke_void_object_NotifyCollectionChangedEventArgs(object,System.Collections.Specialized.NotifyCollectionChangedEventArgs)
ObservableCollection`1[T].OnCollectionChanged (System.Collections.Specialized.NotifyCollectionChangedEventArgs e) /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/external/corefx/src/System.ObjectModel/src/System/Collections/ObjectModel/ObservableCollection.cs:263
ObservableCollection`1[T].OnCollectionChanged (System.Collections.Specialized.NotifyCollectionChangedAction action, System.Object item, System.Int32 index) /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/external/corefx/src/System.ObjectModel/src/System/Collections/ObjectModel/ObservableCollection.cs:338
ObservableCollection`1[T].RemoveItem (System.Int32 index) /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/external/corefx/src/System.ObjectModel/src/System/Collections/ObjectModel/ObservableCollection.cs:182
Collection`1[T].Remove (T item) /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/external/corefx/src/Common/src/CoreLib/System/Collections/ObjectModel/Collection.cs:128
ObservableWrapper`2[TTrack,TRestrict].Clear () D:\a\1\s\Xamarin.Forms.Core\ObservableWrapper.cs:45
StateLayoutController.SwitchToTemplate (Xamarin.CommunityToolkit.UI.Views.LayoutState state, System.String customState, System.Boolean animate)
AsyncMethodBuilderCore+<>c.<ThrowAsync>b__7_0 (System.Object state) /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/AsyncMethodBuilder.cs:1021
SyncContext+<>c__DisplayClass2_0.<Post>b__0 () /Users/builder/azdo/_work/2/s/xamarin-android/src/Mono.Android/Android.App/SyncContext.cs:36
Thread+RunnableImplementor.Run () /Users/builder/azdo/_work/2/s/xamarin-android/src/Mono.Android/Java.Lang/Thread.cs:36
IRunnableInvoker.n_Run (System.IntPtr jnienv, System.IntPtr native__this) /Users/builder/azdo/_work/2/s/xamarin-android/src/Mono.Android/obj/Release/monoandroid10/android-29/mcw/Java.Lang.IRunnable.cs:84
(wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.35(intptr,intptr)
NuGet Packages:
I've played with the sample for about an hour mirroring my project setup and code, and I can't reproduce it either. Very disappointing. Guess I have to live with OneWayToSource binding unless it magically fixes itself.