I'm binding two strings using Multibinding and StringFormat to a TextBox. I've noticed something strange when I add a Converter to one of the inner bindings, like this:
<TextBox>
<TextBox.Text>
<MultiBinding StringFormat="{}{0} {1} ">
<Binding Path="Foo"
Converter="{StaticResource someConverter}"
ConverterParameter="true" />
<Binding Path="Bar" />
</MultiBinding>
</TextBox.Text>
</TextBox>
In the converter the TargetType property is going to be object. Using the same converter directly on a Text property (without the multibinding) it is string.
I'm wondering why is that happening, and if there is any way of letting the converter know about the type of the parent binding (not sure if the terminology is correct here).
The reason I'm asking is that I'm usually checking the to/from types in the converters and I return Binding.DoNothing if there is a mismatch.