WPF: Several layout bug fixes + measure text constraint bug fix in GraphicsContextWrapper.