title: WPF & MVVM - unit testing and pop-up Message Boxes or Dialogs
body: <p>I'm writing an application in MVVM with so far good results.
  But I am doing work in the ViewModel which raises an error, which I want to show to the user to let them know.</p>
  
  <p>I <em>can</em> just do something like this in my ViewModel (VM):</p>
  
  <pre><code>MessageBox.Show(errorMessage);
  </code></pre>
  
  <p>or more likely something like:</p>
  
  <pre><code>new ErrorMessageWindow(errorMessage).ShowDialog()
  </code></pre>
  
  <p>so I can style it.</p>
  
  <p>The problem is then I am creating a UI popup from the VM.
  I'm creating unit tests for the application which also pop up the window and stop running until it's manually closed.</p>
  
  <p>Looking for a good approach.</p>
  
  <p>I was considering raising an event in the VM - but since the View really has no knowledge of the VM or its properties I don't know how I would subscribe to it.</p>
  
  <p>I'm not using any external Frameworks - I'd rather implement anything myself.</p>