Open Jogge opened 5 years ago
Setting the StringFormat
twice, once in the attribute and again in the GettextFormatConverter
is ambiguous.
On the other hand, the attribute approach enables DRY, so no format specification should mean fall back to the DisplayAttribute
, but a given format specification would override that.
<TextBlock Text="{Binding Date, Converter={wpf:GettextFormatConverter Date: {0}}}" />
formats Date according to the DisplayFormat
attribute and
<TextBlock Text="{Binding Date, Converter={wpf:GettextFormatConverter Date: {0:g}}}" />
formats the Date
with the given g
I'm trying to bind to this property with the GettextFormatConverter:
Expected result:
Date: 11-03-2019
Result:
Date: 11-03-2019 00:00:00