title: How to know when a UserControl is no longer used (no Close event)
body: <p>I'm using <code>UserControl</code>s inside a <code>WinForm</code> to display data.
  I'm also using the command pattern so that the <code>UserControl</code> registers a (weak) event and does stuff when the command is triggered.</p>
  
  <p>On a <code>WinForm</code> I can unregister the events in the <code>Close</code> event. However there's no such event on a <code>UserControl</code>.
  I hooked up the events I thought would be fired when the <code>UserControl</code> is no longer in the display stack but could find nothing useful.
  To get by I check if the <code>Parent</code> is null and that worked for most of the cases.</p>
  
  <p>Now I'd like to have a child <code>UserControl</code> of another <code>UserControl</code> (put the <code>UserControl</code> inside a <code>TabControl</code>) and the <code>Parent</code> property isn't going to be null for the child control anymore when the parent is no longer displayed.</p>
  
  <p>Is there any way to know if the <code>UserControl</code> is used?</p>
  
  <p>What I've tried so far: <code>Dispose()</code> doesn't get called straight away by the system so it's no useful; <code>IsVisible</code> doesn't get updated by the system either; there is no <code>Close</code> or <code>Unload</code> event fired.</p>
  
  <p>Cheers.</p>