WPF XAML之bing使用StringFormat

WPF XAML之bing使用StringFormat 

 

// 转化为百分比

 Text="{Binding Progress, StringFormat=\{0:P\}}"

 

 

<TextBlock FontSize="22" Text="{Binding Score, StringFormat={}{0:f1}}" Margin="0,-3,0,0"
                                           Foreground="#FFFE711C" VerticalAlignment="Center" HorizontalAlignment="Right"/>

 

<TextBlock Text="{Binding Date, StringFormat={}{0:MM/dd/yyyy}}" />

 或者

<TextBlock Text="{Binding Time,StringFormat='yyyy:MM:dd HH:mm:ss'}"/>
posted @ 2015-10-08 10:40  莫欺  阅读(361)  评论(0编辑  收藏  举报