如何将多个值绑定到单个 WPF TextBlock? - How to bind multiple values to a single WPF TextBlock?

问题:

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
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章