标签:div 推荐 using -name com price ring dde 代码
原文:WPF XAML日期时间字符串的格式化XAML中的日期格式化跟程序代码中的格式化很类似,但有一些小小的不同:
<Label
Content="{Binding Path=BirthDate}"
ContentStringFormat="{}{0:dd MM YYYY HH:mm:ss}" />
<Label
Content="{Binding Path=BirthDate}"
ContentStringFormat="{}{0:d}" />
<Label
Content="{Binding Path=BirthDate}"
ContentStringFormat="{}{0:t}" />
<Label
Content="{Binding Path=BirthDate}"
/>
<ListView.View>
<GridView AllowsColumnReorder="True">
<GridViewColumn x:Name="colBirthDate" Header="出生日期"
DisplayMemberBinding="{Binding Path=BirthDate, StringFormat=‘{}{0:t}‘}"
Width="Auto"/>
</GridView>
</ListView.View>
<TextBlock Text="{Binding Path=BirthDate, StringFormat={}{0:MM/dd/yyyy}}" />
<TextBlock Text="{Binding Path=BirthDate, StringFormat={}{0:MM/dd/yyyy hh:mm tt}}" />
<TextBlock Text="{Binding Path=Price, StringFormat={}{0:C}}" />
<TextBlock Text="{Binding Path=Price, StringFormat=价格:{0:C}}" />
<Button Content="Delete Me">
<Button.ToolTip>
<ToolTip>
<StackPanel Orientation="Horizontal">
<TextBlock>
<TextBlock.Text>
<MultiBinding StringFormat="Delete {0} {1}">
<Binding Path="FirstName" />
<Binding Path="LastName" />
</MultiBinding>
</TextBlock.Text>
</TextBlock>
鸣谢:
WPF String.Format in XAML with the StringFormat attribute
XAML Using String Format
达叔傻乐(darwin.zuo@163.com)
标签:div 推荐 using -name com price ring dde 代码
原文地址:https://www.cnblogs.com/lonelyxmas/p/12114629.html