问题:
I'm currently using the TextBlock
below to bind the value of a property named Name
:我目前正在使用下面的TextBlock
来绑定名为Name
的属性的值:
<TextBlock Text="{Binding Name}" />
Now, I want to bind another property named ID
to the same TextBlock
.现在,我想将另一个名为ID
属性绑定到同一个TextBlock
。
Is it possible to bind two or more values to the same TextBlock
?是否可以将两个或多个值绑定到同一个TextBlock
? Can it be done with simple concatenation, like Name + ID
and, if not, how else could this be approached?是否可以通过简单的连接来完成,比如Name + ID
,如果不是,还有什么方法可以解决?
解决方案:
参考一: https://en.stackoom.com/question/Ai73参考二: https://stackoom.com/question/Ai73