我有一个TextBlock.当其文本绑定为:
<Binding Path="Applicant2.Surname"/>
Run Code Online (Sandbox Code Playgroud)
它运行正常,但是我想要包含Forenames,所以将绑定更改为:
<MultiBinding StringFormat="{}{0} {1}">
<Binding Path="Applicant2.Forenames"/>
<Binding Path="Applicant2.Surname"/>
</MultiBinding>
Run Code Online (Sandbox Code Playgroud)
这将显示{DependencyProperty.UnsetValue} {DependencyProperty.UnsetValue},直到第一次设置该值.
我怎么能阻止这个?为什么我没有遇到第一个简单绑定的问题?