How can I format a DateTime binding to look exactly (or as similar as possible) like the Messaging Hub.
The following block is the code I’d ideally use to display it, or will I just need to give up and use a converter?
<TextBlock TextAlignment="Right">
<TextBlock.Text>
<Binding Path="Time"
StringFormat="*String format here?*"/>
</TextBlock.Text>
</TextBlock>
The result I’m aiming for is as follows:
- 12:17 (Time only) if today
- Wed, 18:10 (Day + Time) if within 7 days
- 01/04, 15:58 if older than 7 days
You may need to implement a Date to String converter which will produce the specific text you are looking for, as the amount of logic you will require is out of the scope of the StringFormat property.
For more details, in particular the ThreadDateTimeConverter :-
http://www.windowsphonegeek.com/articles/Windows-Phone-Toolkit-DateTime-Converters