开发者

Binding with StringFormat on Windows Phone 7?

I'm doing some Windows Phone 7 development and want to format a string I've bound to.

For some reason I cannot use the StringFormat like shown below. The option just isn't there.

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

开发者_开发问答Why isn't the StringFormat available for Windows Phone 7?


StringFormat was added with 7.1 / Mango since Mango uses SL4. An example from Visual Studio Magazine:

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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜