title: How to detect that a Window has used up its "ShowDialog" call
body: <p>In WPF you get to call <code>ShowDialog</code> on a window exactly once.  After that it is done for.</p>
  
  <p>Seems kind of lame to me, but those are the rules.  If you call <code>ShowDialog</code> again you get this exception:</p>
  
  <blockquote>
    <p>Cannot set Visibility or call Show, ShowDialog, or WindowInteropHelper.EnsureHandle after a Window has closed</p>
  </blockquote>
  
  <p>What I want to know is: How can I take a <code>Window</code> (or <code>UserControl</code> really) and check to see if it has had <code>ShowDialog</code> called (so I know to <code>new</code> up a different one before calling <code>ShowDialog</code> again).</p>
  
  <p>Something like this:</p>
  
  <pre><code>public void ShowListOfClients()
  {
      //    |  This is the method I want to write
      //    V                                          
      RefreshViewIfNeeded(_myWindowOrUserControlThatShowsAList);
  
      FillWindowWithBusinessData(_myWindowOrUserControlThatShowsAList);
      _myWindowOrUserControlThatShowsAList.ShowDialog();
  
  }
  </code></pre>
  
  <p><strong>NOTE:</strong> Clearly in the above example it would be easier to just create a new <code>WindowOrUserControlThatShowsAList</code> every time I enter the method.  But please consider the question more that the dumbed down example.</p>