Stylecop fixes.
Make Window resize itself properly.
Fix measure to handle margins properly.