开发者

UpdateSourceTrigger PropertyChanged in Silverlight?

开发者 https://www.devze.com 2023-03-08 12:44 出处:网络
I am sure most of you have come across this when you type in a textbox you like instantly to filter a ViewCollection acco开发者_C百科rding to has been typed.

I am sure most of you have come across this when you type in a textbox you like instantly to filter a ViewCollection acco开发者_C百科rding 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?


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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号