How to position a Window in WPF

If you want to position a Window in WPF, you can use Window's Left and Top properties.

For example, I have a Window1.xaml in my project. You can write this code on Form load or Application Startup event handler to set the position of Window1. If you want to set on the same window's event, you can use either form's name or this.

Window1 mainWindow = new Window1 ();

            mainWindow.Top = 100;

            mainWindow.Left = 400;

            mainWindow.Show();