title: Wpf: datatemplates and event subscription management
body: <p>Sometimes a Domain Model object with a business logic (DDD) when calling a method an event is fired.
  In my situation, a viewmodel (for a given view) encapsulates the domain object and needs to register and react on those domain events (i must use events because that same domain object can be managed by many loosely coupled views along with their viewmodels).</p>
  
  <p>I also need to unregister to those events when that particular context is hidden.
  I can handle this register/unregister/dispose in parallel with show/hide/dispose of that view using databinding, programmatically or whatever if the scenario keeps simple enough...</p>
  
  <p>The problem comes when visualization logic comes with DataTemplates.
  How can I know when that datatemplate becomes hidden so that I can unregister my events? is it there a better way with wpf to handle this, instead of adding more events?</p>
  
  <p>What is the best practice to handle this scenario in a good MVVM approach?</p>
  
  <p>edit: ok, the problem is structural. sometimes choices made inside the project has forced us to work in an atypical manner... in a good mvvm approach this problem should not happen</p>