How to catch SourceUpdated for nested children of window?
I would like to know when any input element on my Window has its Binding source updated.
The input elements could be TextBox, RadioButton, Slider, ComboBox etc, and may be nested within UserControls or开发者_JAVA技巧 Panels.
Catching SourceUpdated would be nice, but it is not a routed event so is not bubbled to the parent.
Is there a simple way to do this?
SourceUpdated does bubble up from nested children, but NotifyOnSourceUpdated needs to be set on the Binding expression:
<StackPanel SourceUpdated="StackPanel_SourceUpdated">
<TextBox Text="{Binding Path=Val1, NotifyOnSourceUpdated=True}" ></TextBox>
</StackPanel>
I'd still love to hear about a method which does not require setting NotifyOnSourceUpdated for every binding expression.
精彩评论