开发者

Is there an event that fires when a binding is updated?

开发者 https://www.devze.com 2023-02-11 09:02 出处:网络
Is there an event that fires when a binding is updated? 开发者_如何学PythonFor example, I\'d like to create a behavior to be applied to a Combobox that does something every time the Combobox\'s Items

Is there an event that fires when a binding is updated?

开发者_如何学Python

For example, I'd like to create a behavior to be applied to a Combobox that does something every time the Combobox's ItemsSource is updated.


The simple solution that I can think of is, when you say, you want to capture the itemsource change event. Normally this happens when you load the data or source data associated with change, I would raise a property changed event from the actual data source change and intercept that event and do what ever you need to do for item source change.


Yes, NotifyOnSourceUpdated, use that event in the combobox

edit: oops didn't notice you're asking for silverlight, it exists in wpf :x


The whole mechanism is practically based on the propertychanged event, so you can just use that.


Basically Notter Answered the question : to know if a Binding completed, use the TargetUpdated event of your control, and in the binding that interest you, put NotifyOnTargetUpdated=true

0

精彩评论

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

关注公众号