title: Who is responsible for Window View lifecylce in MVVM pattern?
body: <p>It stays for me unclear who creates and disposes windows in WPF.<br/>
  As we know window can be closed by clicking the cross sign in the upper right corner and we can stop closing only by setting Cancel = true in Closing event handler.<br/>
  For me it is quite natural for the ViewModel to decide if View is allowed to close. And I think it is VM whow request the instantiation of the appropriate window.<br/>
  In our project we created <code>IViewManager</code>:</p>
  
  <pre><code>public interface IViewManager
  {
      void ShowView();
      void CloseView();
  }
  
  public interface IWindowedViewModel : IDisposable
  {
      bool IsEnabled {get;set;}
      WindowState WindowState {get;set;}
      Visibility Visibility {get;set;}
      bool IsActive {get;set;}
  
      bool CanBeClosed();
  }
  </code></pre>
  
  <p>So our VMs communicate with the view via bindings and indirectly via <code>IViewManager</code>.
  In the examples of MVVM applications I've seen so far VM is quite passive and is not responsible for View's lifecyle. That's why I have some doubts about our design.<br/>
  I wan't to be sure we are not missing something important concerning MVVM pattern.</p>