Window position

Jul 19, 2010 at 6:43 PM

Does anyone know how I can control the initial position of a window? I've tried all the normal methods none of which are working.

My goal is to save the x,y location so I can restore the window positions.



Aug 6, 2010 at 1:28 PM

Hi Rick

I need the same thing. If the windows where placed inside a Canvas instead of a Grid we would be able to solve this by using the horizontal and vertical offset values..

Nov 21, 2010 at 8:58 PM


You can save the Windows position over a Grid throught the Margin property. Just save this property and set it on window construction.



Nov 25, 2010 at 7:33 PM

Could you show me a small example where this is done?

Nov 26, 2010 at 5:41 PM

I tried setting the margins but could not get it to work.


Dec 5, 2010 at 8:34 PM

Hi all!

I just tested here: it's need to save and restore the following properties: Width, Height and Margin.


Dec 5, 2010 at 11:52 PM

Can you please post some code?



Jan 19, 2012 at 12:42 AM

Sample to setup margins shift Left=50 and Top=50 from the center:

window.Margin = new Thickness(50, 50, -50, -50)