PartialTextChanged项目选择之后停止射击MvxAutoCompleteTextView [英] PartialTextChanged stops firing on MvxAutoCompleteTextView after Item selection

查看:344
本文介绍了PartialTextChanged项目选择之后停止射击MvxAutoCompleteTextView的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用MVVMCross的周围Xamarin的Andr​​oid AutoCompleteTextView包装。

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

我用的是PartialTextChanged更改事件的信号,我需要调用视图模型,从视图,以获得更多的建议。

I use the PartialTextChanged changed event to signal that I need to call the ViewModel, from the View, to get some more suggestions.

这工作得很好了用户从列表中选择一个项目点。那之后没有修改的文本会导致PartialTextChanged事件触发。这是因为如果过滤已关闭一次选择完毕

This works fine up to the point the user selects an item from the list. After that point no changes to the text will cause the PartialTextChanged event to fire. It is as if filtering is turned off once a selection has been made.

有上似乎打开\但我不确定的最佳方式使用过滤AutoCompleteTextView一个setText方法。

There is a SetText method on the AutoCompleteTextView that seems to turn filtering on\off but I am unsure of the best way to use that.

在TextChangedEvent仍是起火的控制,并AfterTextChanged只是没有PartialTextChanged,这是驱动的更新。

The TextChangedEvent still fires on the control as does AfterTextChanged just not PartialTextChanged and it is that which drives the updates.

我已经通过MVVMCross源调试并不能看到一个解决方案。任何有什么想法?

I have debugged through the MVVMCross source and cannot see a solution. Any have any ideas?

我在哪里可以浏览他们mondroid \ xamarin安卓code?

Where can I browse them mondroid\xamarin android code?

感谢

推荐答案

安装的MVVMCross来源$ C ​​$ c和调试所有我发现,在某些情况下,我不更新的ItemsSource的PartialText属性已被更改后的事件后,

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

该FilteringAdapter使用的ManualResetEvent周围的变化PartialText而这仅仅是信号\通过NotifyDataSetChanged方法设置。

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

找到这个之后,我还发现,@slodge也提到了这一点这个答案,<一个href="http://stackoverflow.com/questions/10550829/autocomplete-mvvm-and-java-castings-without-using-java-lang-object-on-viewmodel">AutoComplete MVVM和Java铸件,而无需使用的java.lang.Object的视图模型。约束,到现在为止已经从我身边走过。

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.

请注意,因为Android的线程模型,这是至关重要的   在PartialText每一个变化是由最终信号的变化满足   的ItemsSource - 这应该是对象集合单个更改   而不是很多小的变化。

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.

感谢

这篇关于PartialTextChanged项目选择之后停止射击MvxAutoCompleteTextView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆