I just completed a blog post on this very topic. In a nutshell, add an ActionAction property to your ViewModel with getget and setset accessors. Then define the ActionAction from your View'sView constructor. Finally, invoke your action in the bound command that should close the window.
In the ViewModel:
public Action CloseAction { get; set;} and in the ViewView constructor:
private View() { InitializeComponent(); ViewModel vm = new ViewModel(); this.DataContext = vm; if ( vm.CloseAction == null ) vm.CloseAction = new Action( () => this.Close() ); } Finally, in whatever bound command that should close the window, we can simply invoke
CloseAction(); // Calls Close() method of the View This worked for me, seemed like a fairly elegant solution, and saved me a bunch of coding.