
WPF Binding StringFormat 无效
当我使用TextBox
或者TextBlock
时, StringFormat
是有效的, 但是使用Label
时, 就无效了, 比如
<Label Content="{Binding roomGoods.totalCount,StringFormat=TotalCount: {0:C}}"/>
只会显示totalCount
的内容, 但是不会显示前面的TotalCount:
部分
经过查询, 加入如下属性
<Label Content="{Binding roomGoods.totalCount}" ContentStringFormat="TotalCount: {0}"/>