I just want to share a point that kept me busy for a while after i applied this article:
if you want to restore the state of your window, don't change its WindowState property to Maximized in your designer. I had it like this and it refused to change the values in Me.Top and the other props.
The debugger just went through the code and nothing changed.
It seemed really strange because these properties are writeable.
The solution was to set the state property to Normal, which is the default.