【问题标题】:Binding with StringFormat on Windows Phone 7?在 Windows Phone 7 上与 StringFormat 绑定?
【发布时间】:2010-12-30 23:39:35
【问题描述】:

我正在做一些 Windows Phone 7 开发,并且想要格式化我绑定的字符串。

由于某种原因,我不能使用如下所示的 StringFormat。该选项不存在。

 <TextBlock Text="{Binding Distance, StringFormat=\{0\}km}" />

为什么 StringFormat 不适用于 Windows Phone 7?

【问题讨论】:

    标签: windows-phone-7


    【解决方案1】:

    由于 Mango 使用 SL4,7.1 / Mango 添加了 StringFormat。来自Visual Studio Magazine的例子:

    <TextBlock Text="{Binding CurrentDate,StringFormat='dddd, d MMMM yyyy'}" />
    

    【讨论】:

      猜你喜欢
      • 2011-08-17
      • 2011-06-20
      • 1970-01-01
      • 2016-04-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-09-11
      • 2012-10-03
      相关资源
      最近更新 更多