title: Set WindowStartupLocation to the Margin.Top of Button1 of the main window
body: <p>I'm working on a project where I have to add a small preview pane and a about box whenever a user is hovering the buttons on the main window.</p>
  
  <p>For the examlpe: I have a window - preview.xaml, and my main window called MainWindow.xaml.</p>
  
  <p>How do I set the preview windows bottom to appear on the top of button1 on the MainWindow?</p>
  
  <p>I tried something like this without any luck:</p>
  
  <pre><code>public preview()
  {
     InitializeComponent();
     this.WindowStartupLocation = WindowStartupLocation.Manual;
     Top = mainWindow.button1.Margin.Top;
  }
  </code></pre>
  
  <p>I hope my ramblings makes any sense... </p>
  
  <p>Any help is greatly appreciated!</p>