试试这个:在地铁XAML
<TextBlock x:Name="someText" TextWrapping="NoWrap">
<Run Text="{Binding ElementName=theList, Path=SelectedItem, Mode=TwoWay}" />
<Run Text=" Arrow." />
</TextBlock>
XAML的解决方案尚未公布:
您可以使用StringFormat:
<TextBlock x:Name="someText" Text="{Binding ElementName=theList, Path=SelectedItem, Mode=TwoWay, StringFormat={}{0} Arrow.}" />
您也可以使用MultiBinding和StringFormat :
<TextBlock>
<TextBlock.Text>
<MultiBinding StringFormat="{}{0} Arrow.">
<Binding ElementName="theList" Path="SelectedItem.Name" />
</MultiBinding>
</TextBlock.Text>
</TextBlock>
至于StringFormat:在类型绑定中未找到'Property'StringFormat'。'并且'MultiBinding在Windows Metro风格的项目中不受支持。' – Arrow
@Arrow你是对的。用Run运行我的第一个解决方案。 – kmatyaszek
具有多个“运行”的'TextBlock'绝对是实现这一目标的方法。 –