title: Model-View-Presenter and Modal Dialog boxes.... How to?
body: <p>I am implementing MVP/M-V-VM in WPF and I'm having good luck with it so far.  However, I don't see how this model supports implementing Modal dialog boxes.  I've derived my work from Crack.NET (<a href="http://www.codeplex.com/cracknetproject" rel="nofollow noreferrer">http://www.codeplex.com/cracknetproject</a>) to learn how this stuff works.</p>
  
  <p>I have a ShellView view (which is just XAML) that has a menu on it.  The menu binds to a command in the ShellModelView that says "EditPreferences".</p>
  
  <p>The ShellModelView implements the ICommand for EditPreferences and here we want to put up a dialog box to let the user edit preferences for the application.  </p>
  
  <p>Several problems here:
  1.  The ShellModelView doesn't have a reference to the ShellView to properly parent the dialog.  The ShellModelView is the DataContext of the ShellView but I don't see a backreference that's setup.
  2.  The ShellModelView shouldn't be loading explicit UI anyway.  So what's the proper interaction model here?
  3.  How do I build up my PreferencesDialog so that it's properly separated between logic and view as well?  PreferencesDialog itself needs to be a Window so you can call ShowDialog on it, but that means you need a reference to the Window (e.g. View) in order to instantiate it.  Ideally I should be able to unit test the code/validation within PreferencesDialog without instantiating the view (using a Mock view perhaps?).</p>