对于单个绑定,我们使用:
<TextBlock>
<TextBlock.Text>
<MultiBinding StringFormat="{}{0}">
<Binding Path=EmployeeName/>
</MultiBinding>
</TextBlock.Text>
</TextBlock>
或更短的语法:
<TextBlock
Text="{MultiBinding StringFormat=\{0\}, Bindings={Binding Path=EmployeeName}}"/>
现在,如果你有多重绑定:
<TextBlock>
<TextBlock.Text>
<MultiBinding StringFormat="{}{0}, {2}">
<Binding Path="EmployeeName"/>
<Binding Path="Age"/>
</MultiBinding>
</TextBlock.Text>
</TextBlock>
我想知道,它的较短语法是什么?
<TextBlock
Text="{MultiBinding StringFormat=\{0\}, Bindings={Binding ??????}"/>