【发布时间】:2014-09-08 12:55:19
【问题描述】:
我正在做一件非常简单的事情,就是在标签中显示这样的文本:
LastName, FirstName
My View 绑定到包含 FirstName 和 LastName 属性的 ViewModel。我想做这样的事情:
<Label Content="{Binding LastName}, {Binding FirstName}"
以上当然不行。因此,我将 FirstName 和 LastName 连接起来,并从 ViewModel 作为 FullName 返回,并像这样绑定它:
<Label Content="{Binding FullName}"/>
以上是更好的方法吗?因为,现在我必须对 City, State 做同样的事情。
【问题讨论】: