I haf a DateTime Property. This is Bound to a Textbox with
<TextBlock Grid.Column="1" Grid.Row="0" Text="{Binding StartDateString, Mode=TwoWay}" x:Name="date" />
In WPF it was possible to format the DateTime Output with the following syntax
<TextBlock Grid.Column="1" Grid.Row="0" Text="{Binding StartDateString, FormatString="dd.mm.yyyy" Mode=TwoWay}" x:Name="date" />
In the Metro Apps (winrt ... Windows Store Apps... how it is called now?), the FormatString property is not possible.
Is there another way to do the format in the xaml file?
You're right. There isn't a FormatString
parameter in WinRT. You should probably use a value converter. Here's a link to one that should do what you want:
http://blogs.u2u.be/diederik/post/2012/03/19/A-StringFormat-converter-for-Windows-8-Metro.aspx
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With