UpdateSourceTrigger属性在Silverlight中更改了吗? [英] UpdateSourceTrigger PropertyChanged in Silverlight?

查看:139
本文介绍了UpdateSourceTrigger属性在Silverlight中更改了吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我敢肯定,当您键入一个文本框时,您中的大多数人都会遇到这种情况,您想立即根据输入的内容过滤ViewCollection.

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.

在WPF中非常简单,只需将文本绑定的UpdateSourceTrigger更改为PropertyChanged.

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

如您所料,Silverlight没有它.只是默认的和显式的.

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

我想到了将交互行为绑定到文本框的TextChanged事件的想法.您会推荐这种方法还是有更好的方法?

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?

推荐答案

行为是解决问题的一种方法,我认为这是公认的方法.我还看到了用附加属性解决它的文章(可能是更干净的XAML语法,但我从未尝试过).这些是第一个出现的链接,我完全没有对其进行测试(应该很容易找到其他链接):

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):

行为

附加属性

这篇关于UpdateSourceTrigger属性在Silverlight中更改了吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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