开发者

Can I detect binding changes in Silverlight?

Is there a way to detect when a binding is changed开发者_如何学C? I'm not asking about the value, I mean the binding expression itself.


The only way I can imagine doing this would be to track the BindingExpression whenever the property changes. The property callback ought to fire when the binding is changed. In call back use GetBindingExpression to retrieve and store a reference to the current BindingExpression.

With each callback execution check whether the current reference held is the same reference returned by GetBindingExpression, if not the binding has been changed.

This only works on a FrameworkElement derivative though, I can't think of a way to do this on a UIElement or raw DependencyObject.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜