我如何以给定的格式(7/24/13, 11:24 AM)格式化 DateTime,我找到了一个以类似方式格式化字符串的选项 [Text="{Binding CreatedDate, StringFormat={0:g}}"] , 但我不能在日期和时间之间添加 (",") 逗号。我如何在 Windows 手机中做到这一点。目前使用字符串格式,我得到这样的日期(7/24/13 11:24 AM)。
最佳答案
<TextBlock Text="{Binding Date, StringFormat='{}{0:MM/dd/yyyy, h:mm tt}'}" />
会给你
2013 年 8 月 22 日,上午 11:52
关于silverlight - Windows Phone 中的 XAML 字符串格式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18376722/