I have a TextBlock. When its Text is bound as:
<Binding Path="Applicant2.Surname"/>
It works fine, however I want to include the Forenames so changed the binding to:
<MultiBinding StringFormat="{}{0} {1}">
<Binding Path="Applicant2.Forenames"/>
<Binding Path="Applicant2.Surname"/>
</MultiBinding>
This displays {DependencyProperty.UnsetValue} {DependencyProperty.UnsetValue} until the value is set the first time.
How can I stop this? Why do I not get the problem with the first simple binding?
for a multibinding you need to add a fallback value if it is just blank then you can simply do:
<MultiBinding StringFormat="{}{0} {1}">
<Binding Path="Applicant2.Forenames" FallbackValue=""/>
<Binding Path="Applicant2.Surname" FallbackValue=""/>
</MultiBinding>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With