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
.
精彩评论