title: How do I remove event handlers when I'm finished with a View and ViewModel, but not the Model
body: <p>In my application, I am often creating new Views and ViewModels, but persisting the same Models. For example, I might show a simple view of a list of items in my main window, and have another window with further details of any particular item. The detail window can be opened and closed at any time, or multiple windows can be opened simultaneously for different items on the list.</p>
  
  <p>Therefore, there can be more than one ViewModel for a given model object, and they need to be updated with changes from other places. (I'm using <code>INotifyPropertyChanged</code> on my models.) I want to get rid of ViewModels when I am done with them, i.e., as the detail window is closed.</p>
  
  <pre><code>public DetailViewModel(MyDetailModel detailModel)
  {
      // Retain the Detail Model
      this.model = detailModel;
  
      // Handle changes to the Model not coming from this ViewModel
      this.model.PropertyChanged += model_PropertyChanged;  // Potential leak?
  }
  </code></pre>
  
  <p>It is my understanding that the event handler will cause the Model to retain a reference to the ViewModel, and keep it from getting garbage collected.</p>
  
  <p>1)  Is this correct?  How can I tell if these references are still present?</p>
  
  <p>2)  How should I determine the ViewModel is no longer needed and unsubscribe from the events?</p>