开发者

Binding with StringFormat on Windows Phone 7?

开发者 https://www.devze.com 2023-02-02 01:35 出处:网络
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.

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

精彩评论

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