title: Closing wpf window before opening a new one
body: <p>I have a button that opens a WPF window which shows some calculation.</p>
  <pre><code>public void SomeButton_Click(object sender, RoutedEventArgs e)
  {
      Window1 win2 = new Window1();
      win2.Show();
      win2.Topmost = true;
  }
  </code></pre>
  <p>I have a problem that if I change values in the program and press the button again, I have two open windows.
  Is there a way that I can close <code>win1</code> before opening the new version of <code>win2</code>?
  I tried with <code>win2.Close()</code>, but since <code>win2</code> is not known before the application creates it won't obviously work.</p>
  <p>Thanks.</p>