title: WPF : How to set a Dialog position to show at the center of the application?
body: <p>How to set Dialog's position that came from  <code>.ShowDialog();</code> to show at the center of the mainWindows.</p>
  
  <p>This is the way I try to set position.</p>
  
  <pre><code>private void Window_Loaded(object sender, RoutedEventArgs e)
  {        
      PresentationSource source = PresentationSource.FromVisual(this);
      if (source != null)
      {
          Left = ??
          Top = ??
      }
  }
  </code></pre>