【发布时间】:2010-12-30 23:39:35
【问题描述】:
我正在做一些 Windows Phone 7 开发,并且想要格式化我绑定的字符串。
由于某种原因,我不能使用如下所示的 StringFormat。该选项不存在。
<TextBlock Text="{Binding Distance, StringFormat=\{0\}km}" />
为什么 StringFormat 不适用于 Windows Phone 7?
【问题讨论】:
标签: windows-phone-7
我正在做一些 Windows Phone 7 开发,并且想要格式化我绑定的字符串。
由于某种原因,我不能使用如下所示的 StringFormat。该选项不存在。
<TextBlock Text="{Binding Distance, StringFormat=\{0\}km}" />
为什么 StringFormat 不适用于 Windows Phone 7?
【问题讨论】:
标签: windows-phone-7
由于 Mango 使用 SL4,7.1 / Mango 添加了 StringFormat。来自Visual Studio Magazine的例子:
<TextBlock Text="{Binding CurrentDate,StringFormat='dddd, d MMMM yyyy'}" />
【讨论】: