Copy of http://lifeofadev.blogspot.co.uk/2011/02/wpf-using-only-f-and-xaml-part-1.html