xaml代码中的日期字符串格式 [英] string formart for date in xaml code
本文介绍了xaml代码中的日期字符串格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
为了通过xaml代码在文本框中显示日期:
in order to show date in Text box by xaml code :
<textblock name="tbArrivalDateTime">
Text="{Binding Source={x:Static sys:DateTime.Today},
StringFormat=''{}{0:dd-MMM-yyyy}''}"
VerticalAlignment="Center"
Grid.Row="3"
Grid.Column="1"
Margin="10,0,0,0"
HorizontalAlignment="Left"/>
结果如下:12/29/2012
我需要在3 texblock中显示结果的问题
第一个显示日名称
第二个节目日期号码
第三个月份名称
结果必须如下:
周六。
29
12月
和frensh
Sam。
29
12月
法语和英语。
任何想法
the result for this is for example: 12/29/2012
the problem that i need to show the result seperated in 3 texblock
the first show day name
the second show day number
the third show month name
the result must be like this:
Sat.
29
Dec
and in frensh
Sam.
29
Dec
in french and english.
any idea for this
推荐答案
I强烈建议您使用 IValueConverter
,使用它可以获得更多灵活性来获得此类输出结果。
I strongly recommend to U use IValueConverter
, with it you can gain more flexibility for such output result .
这篇关于xaml代码中的日期字符串格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文