WPF Binding StringFormat 无效

当我使用TextBox或者TextBlock时, StringFormat是有效的, 但是使用Label时, 就无效了, 比如

1
<Label Content="{Binding roomGoods.totalCount,StringFormat=TotalCount: {0:C}}"/>

只会显示totalCount的内容, 但是不会显示前面的TotalCount: 部分

经过查询, 加入如下属性

1
<Label Content="{Binding roomGoods.totalCount}" ContentStringFormat="TotalCount: {0}"/>
记录平时瞎折腾遇到的各种问题, 方便查找
使用 Hugo 构建
主题 Stack 3.29.0Jimmy 设计