title: Problems with wpf windows location
body: <p>I have an application that runs in a second screen, when the user runs the application in the first screen the application detect the second monitor and change their position to the secondary screen.</p>
  
  <p>This have a problem, the the children of the main window, appear in the first monitor. This should not happen if the owner property is correctly established.</p>
  
  <pre><code>Window1 w = new Window1();
  win.Owner = Application.Current.MainWindow;
  </code></pre>
  
  <p>My application is complex and is composed by components thats are calling child windows, but I attached a code to illustrate the problem. Execute the code in first monitor, move manually the window to the secondary monitor and press the button to call the child window thats appear in the first monitor :( .</p>
  
  <p><strong>Note</strong>: I know that I can write a code that detect the secondary monitor in each child window and move to then, but I want a solution more simple and correct, if is possible.</p>
  
  <p><strong>Note2</strong>: Runs the application outside visual studio, direct from the '.exe'. In Visual studio works fine.</p>
  
  <pre><code>&lt;Window x:Class="Test.MainWindow"
          xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
          xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
          xmlns:Control="clr-namespace:Borrarrrrr"
          Title="MainWindow" Height="350" Width="525"&gt;
      &lt;Grid&gt;
          &lt;Control:UserControl1  x:Name="ctr" /&gt;
      &lt;/Grid&gt;
  &lt;/Window&gt;
  
  public partial class MainWindow : Window
  {
      public MainWindow()
      {
          InitializeComponent();
      }
  
      private void Button_Click(object sender, RoutedEventArgs e)
      {
          Window1 w = new Window1();
          //w.Owner = this;
          w.Owner = Application.Current.MainWindow;
          w.Show();
      }
  }
  
  
  &lt;UserControl x:Class="Test.UserControl1"
               xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
               xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
               xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
               xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
               mc:Ignorable="d" 
               d:DesignHeight="300" d:DesignWidth="300"&gt;
      &lt;Grid&gt;
          &lt;Button Click="Button_Click"&gt;&lt;/Button&gt;
      &lt;/Grid&gt;
  &lt;/UserControl&gt;
  
      public partial class UserControl1 : UserControl
      {
          public UserControl1()
          {
              InitializeComponent();
          }
  
          private void Button_Click(object sender, RoutedEventArgs e)
          {
              Window1 w = new Window1();
              w.Owner = Application.Current.MainWindow;
              w.Show();
          }
      }
  
  
  &lt;Window x:Class="Test.Window1"
          xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
          xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
          Title="Window1" Height="300" Width="300" 
          WindowStartupLocation="CenterOwner" WindowStyle="None" AllowsTransparency="True"
          WindowState="Maximized"&gt;
      &lt;Grid Background="Aqua"&gt;
  
      &lt;/Grid&gt;
  &lt;/Window&gt;
  </code></pre>