I know that I can rebind all instances of a specific property for a specific type of element, as in this method that rebinds the Text property of all Textblocks.
public void Rebind()
{
foreach (var textBlock in LayoutRoot.GetDescendents().OfType<TextBlock>())
{
BindingExpression bindExp = textBlock.GetBindingExpression(TextBlock.TextProperty);
if (bindExp != null)
{
Binding bind = bindExp.ParentBinding;
textBlock.SetBinding(TextBlock.TextProperty, bind);
}
}
}
What I want to be able to do though is rebind all properties that have bindings for all elements in the visual tree. More specifically I would like to rebind all bindings that use a specific value converter. How might I do so?