How to retrieve (using code-behind) binding expression from control bounded with using MultiBinding?
Asked
Active
Viewed 257 times
1 Answers
2
Using BindingOperations.GetMultiBindingExpression method.
Example:
<TextBlock x:Name="MyTextBlock">
<TextBlock.Text>
<MultiBinding Converter="{StaticResource myConverter}">
<Binding ElementName="lst" Path="Items.Count" />
<Binding ElementName="txtName" Path="Text" />
<Binding ElementName="txtAge" Path="Text" />
</MultiBinding>
</TextBlock.Text>
</TextBlock>
Accesing it from code:
TextBlock textblock = FindName("MyTextBlock") as TextBlock;
var bindingExpression = BindingOperations.GetMultiBindingExpression(textblock, TextBlock.TextProperty);
Hope this helps

Omri Btian
- 6,499
- 4
- 39
- 65