PartialTextChanged stops firing on MvxAutoCompleteTextView after Item selection

后端 未结 1 1216
北恋
北恋 2020-12-18 06:20

I am using MVVMCross\'s wrapper around the Xamarin Android AutoCompleteTextView.

I use the PartialTextChanged changed event to signal that I need to call the ViewMod

相关标签:
1条回答
  • 2020-12-18 07:06

    After attaching the MVVMCross Source Code and debugging all the events I found that under certain circumstances I was not updating the ItemsSource after the PartialText property was being changed

    The FilteringAdapter uses a ManualResetEvent around the change to PartialText and that is only signalled\set by the NotifyDataSetChanged method.

    After finding this I also found that @slodge also mentions this in this answer, AutoComplete MVVM and Java Castings without using Java.Lang.Object on ViewModel. A constraint that until now had passed me by.

    Note that because of the Android threading model it is essential that every change in PartialText is met by an eventual signalled change in ItemsSource - and this should be a single change in object collection rather than lots of small changes.

    Thanks

    0 讨论(0)
提交回复
热议问题