title: Show WPF window from test unit
body: <p>I am running a test unit (and learning about them). Quite simply, my unit creates a List and passes it to my MainWindow. </p>
  
  <p>The issue I have is after I <code>show()</code> the main window the unit method ends. I want the unit to not finish until I close the MainWindow. This is what I've done (see below) - it obviously doesn't work and feels like I'm on the wrong path here. How can I do this properly?</p>
  
  <pre><code>    [TestClass]
      public class Logging
      {
          bool continueOn = true;
          [TestMethod]
          public void ShowLogs()
          {
              ShowResults(createLogList());
          }
  
          private void ShowResults(List&lt;Log&gt; logList)
          {
              MainWindow mw = new MainWindow(logList);
              mw.Closed += mw_Closed;  
              mw.Show();
  
              while (continueOn)
              { }
          }
  
          void mw_Closed(object sender, EventArgs e)
          {
              this.continueOn = false;
          }
  
          private List&lt;Log&gt; createLogList()
          {
              List&lt;Log&gt; listLog = new List&lt;Log&gt;();
              //logic 
              return listLog;            
          }
  </code></pre>
  
  <p>Maybe I have to put this onto a background worker thread and monitor that - to be honest I've no idea and before I waste hours, I'd appreciate some guidance.</p>