I have an TextBlock showing a date using the standard short date format for the current culture.
String.Format(culture, "{0:d}", someDate)
Now, the product manager wants the year highlighted in bold. At first, I thought it would be easy enough; have one run bound to the day/month-part, an a second to the year part.
<TextBlock>
<Run Text="{Binding DayMonthPart}"/>
<Run FontWeight="Bold" Text="{Binding YearPart}"/>
</TextBlock>
But that wont do, since different cultures have different ordering. Some put the year first, some put it last.
So, how can I make this happen?
Any ideas?
This is generic solution that works for all cultures:
And then in your XAML: