title: WPF: how to signal an event from ViewModel to View without code in codebehind?
body: <p>I have quite simple (I hope :)) problem: </p>
  
  <p>In MVVM, View usually listens on changes of ViewModel's properties. However, I would sometimes like to listen on event, so that, for example, View could start animation, or close window, when VM signals. </p>
  
  <p>Doing it via bool property with NotifyPropertyChanged (and starting animation only when it changes from false to true) is possible, but it feels like a hack, I'd much prefer to expose event, as it is semantically correct.</p>
  
  <p>Also, I'd like to do it without code in codebehind, as doing <code>viewModel.myEvent += handler</code> there would mean that I'd have manually unregister the event in order to allow View to be GC'd - WPF Views are already able to listen on properties 'weakly', and I'd much prefer to program only declaratively in View.</p>
  
  <p>The standard strong event subscription is also bad, because I need to switch multiple ViewModels for one View (because creating View every time takes too much CPU time).</p>
  
  <p>Thank you for ideas (if there is a standard solution, a link to msdn will suffice)!</p>