title: WPF (MVVM): Closing a view from Viewmodel?
body: <p>Anybody come across a clever way of closing a view in a viewmodel using MVVM?</p>
  
  <p>Maybe there is a way of using binding to signal the view (window) to close?</p>
  
  <p>I would really appreciate any input anyone has.</p>
  
  <p>Basically i have a loginView that is bound to a loginViewModel, in the viewmodel (using binding on a command) i test to see if the login is successful and if it is i basically load up a new View (mainview) and attach its datacontext... </p>
  
  <p>but i still have the loginView shown - so i need to signal it to unload..</p>
  
  <p>I was also hoping for a generic solution because i am sure that i am going to need to do this sort of thing in other situations</p>
  
  <p>Any ideas?</p>