In the case of the following MultiBinding expression how many times will the binding engine search for the DataGrid ancestor IF the PropB is changed multiple times?
<MultiBinding Converter="{StaticResource TestConverter}">
<Binding Path="PropA"/>
<Binding Path="PropB" />
<Binding Path="DataContext.Sub.PropertyC" RelativeSource="{RelativeSource Mode=FindAncestor,AncestorType=DataGrid}" />
</MultiBinding>
Will it search only once if the PropertyC (and the path to it) is never changed? Or will it search the ancestor each time one of the Properties in the multibinding is changed? Assuming there are change notifications on each property.
The only way I see possible to test this is by actually removing controls in order to see if it finds the proper control.
Testing it this way, it looks as if it is evaluated only once whether using a
MultiBinding
or not.When running it initially you will see:
When clicking the button, it will remove the first child and change the TextBlocks to display newer text to indicate which one it now binds to.