UpdateSourceTrigger PropertyChanged in Silverlight?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-10 16:39:55

问题


I am sure most of you have come across this when you type in a textbox you like instantly to filter a ViewCollection according to has been typed.

Its very straight forward in WPF, just change the UpdateSourceTrigger for Text binding to PropertyChanged.

As you would expect Silverlight doesnt have it. There is just a default and explicit instead.

I had the idea to bind an Interaction behavior to TextChanged event of the textbox instead. Would you recommend this approach or is there a better way?


回答1:


A behavior is the way it was solved on my team, and I think is the generally accepted method. I have also seen articles solving it with Attached Properties (might be cleaner XAML syntax, but I have never tried it). These are the first links that came up, completely untested by me (should be easy enough to find others):

Behavior

Attached Property



来源:https://stackoverflow.com/questions/6145994/updatesourcetrigger-propertychanged-in-silverlight

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!