Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 386
Frode Lillerud Avatar asked Nov 28 '25 21:11

Frode Lillerud


1 Answers

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'}" />
like image 171
bkaid Avatar answered Dec 02 '25 04:12

bkaid