Use new ErrorMessage class in window.

As done in this example, all other windows using ErrorMessage will need
to add a StackPanel (with margin, for prettiness) as the window's
immediate child. This allows us to easily add a child to the end of the
stackpanel which will get positioned at the end of the window by
default, where the errors should be.

Also did some code cleaning.