title: Open Window on the Same Monitor as MainWindow
body: <p>I've seen many questions regarding similar issues, but I haven't found one quite specific enough to my question to find an answer yet.</p>
  
  <p>I allow the user to move the MainWindow of my program around and, if they have one, onto another monitor. When they click to add something on the MainWindow, a new Window is created so they can fill in a form.</p>
  
  <p>The problem is that this new Window will start on the primary screen of the OS instead of starting on the screen that the MainWindow is currently located on.</p>
  
  <p>I had a look at this question; <a href="https://stackoverflow.com/questions/29023376/how-to-make-a-dialogview-open-up-on-the-same-monitor-as-the-main-window">How to make a dialog(view) open up on the same monitor as the main window</a> and saw that setting the owner to the MainWindow worked in this case. So I added </p>
  
  <p><code>Owner = Application.Current.MainWindow;
  </code></p>
  
  <p>into the Window_Loaded method the new Window. This does load the Window on the same screen as the MainWindow but then crashes, stating <code>Cannot set Owner property after Dialog is shown.</code></p>
  
  <p>Naturally I move the setting of the Owner property to before the new Window is shown, so it looks like this; </p>
  
  <p><code>contractAddwindow.Owner = Application.Current.MainWindow;
  contractAddwindow.ShowDialog();</code></p>
  
  <p>however this then has the same issue as before, the <code>contractAddWindow</code> starts on the primary screen.</p>
  
  <p>So my question is, how do I force the new Window to load on the same monitor as the MainWindow instead of the primary screen?</p>