title: WPF control retained in memory due to DispatcherTimer EventHandler
body: <p>Yo</p>
  
  <p>One of my WPF control is retained in memory due to one of its private member. The incriminate member is a DispatcherTimer and the retention is because of the Tick event handler. (This leak was detected with help of the tool ANTS Memory Profiler)</p>
  
  <p>Obviously, I set/remove the handler on load/unload. And the control is unloaded... </p>
  
  <pre><code>void TransportControl_Loaded(object sender, RoutedEventArgs e)
  {
    if (m_playheadTimer == null)
    {
      m_playheadTimer = new System.Windows.Threading.DispatcherTimer();
      m_playheadTimer.Tick += PlayheadTimer_Tick;
      m_playheadTimer.Interval = TimeSpan.FromMilliseconds(50);
    }
  }
  
  void TransportControl_Unloaded(object sender, RoutedEventArgs e)
  {
    if (m_playheadTimer != null)
    {
      if (m_playheadTimer.IsEnabled)
        m_playheadTimer.Stop();
  
      m_playheadTimer.Tick -= PlayheadTimer_Tick;
    }
  }
  </code></pre>
  
  <p>But still I'm stuck with that trouble (the same as my control is stuck in memory).
  Any ideas, THX</p>