WPF: StringFormat problems with a Label

These versions work as expected:

<DataGridTextColumn Header="Total Units" Binding="{Binding TotalUnits, Mode=OneWay, StringFormat=N0}"/>

<TextBlock Text="{Binding TotalUnits, Mode=OneWay, StringFormat=N0}"/>

When I try it with a label, the StringFormat is iqnored and I get "123.000000" instead of "123".

<Label Content="{Binding TotalUnits, Mode=OneWay, StringFormat=N0}"/>

TotalUnits is a Decimal.

So, what's going on?

22
задан Jonathan Allen 30 September 2010 в 00:10
поделиться