18 December, 2013

StringFormat in XAML

Right, these XAML constructs are really heavy candidates for esoteric knowledge! Who on earth can remember all these “€djs{kdis.,00dx}”-like syntax, honestly ?

So, anyway – to cut to the bone; to format a datetime property in XAML to a specific display you go like this:

image

This will format: 12/31/2013 3 pm –> 31.12.2013 15:00


A fairly good overview is gained here:                
http://elegantcode.com/2009/04/07/wpf-stringformat-in-xaml-with-the-stringformat-attribute/

No comments: