title: DataContextChanged doesn't fire in code behind, even after PropertyChanged in view model
body: <p>I want to set the DataContext of a UserControl to a new value, but I am not being successful at it. </p>
  
  <ul>
  <li>I have an UserControl whose DataContextChanged event would write something to Console. </li>
  <li>I have an instance of that UserControl in XAML, with DataContext bound to the correct property;</li>
  <li>I have a <code>RaisePropertyChanged</code> (from MVVM-Light) with a breakpoint configured to write to Console too.</li>
  </ul>
  
  <p>The fact is: Even if the RaisePropertyChanged fires (as shown by breakpoint), the DataContextChanged handler is not called (as shown either by breakpoint or <code>Console.WriteLine</code>)</p>
  
  <p>IMPORTANT: When the UserControl is first loaded, it displays the value correctly (that is, it "gets" the value from ViewModel) and the messagem from DataContextChanged is printed to Console. The problem is that I can't get the DataContextChanged handler to fire when calling PontoCanalZoom <em>setter</em>, even if RaisePropertyChanged fires appropriately.</p>
  
  <p>ViewModel:</p>
  
  <pre><code>public class AnáliseViewModel : ObservableObject
  {
      public PontoAnáliseViewModel PontoCanalZoom
      {
          get
          {
              if (_pontoCanalZoom == null)
                  _pontoCanalZoom = PontosAtivos?.FirstOrDefault();
  
              return _pontoCanalZoom;
          }
          set
          {
              _pontoCanalZoom = value;
              RaisePropertyChanged(() =&gt; PontoCanalZoom);
          }
      }
      private PontoAnáliseViewModel _pontoCanalZoom = null;
  }
  
  public ICommand ComandoSelecionarCanalNavegação =&gt; new RelayCommand&lt;PontoAnáliseViewModel&gt;(SelecionarCanalNavegação);
  private void SelecionarCanalNavegação(PontoAnáliseViewModel ponto)
  {
      // This calls the setter _and_ raises PropertyChanged event.
      PontoCanalZoom = ponto;
  }
  </code></pre>
  
  <p>Instance of Control (<code>AreaPlotagemAnáliseEMG</code>):</p>
  
  <pre><code>        &lt;plotagem:AreaPlotagemAnáliseEMG 
              DataContext="{Binding PontoCanalZoom, Mode=OneWay}"/&gt;
  </code></pre>
  
  <p>Control definition:</p>
  
  <pre><code>public partial class AreaPlotagemAnáliseEMG : AreaPlotagemBase
  {
      public AreaPlotagemAnáliseEMG()
      {
          InitializeComponent();
  
          DataContextChanged += (a, b) =&gt; System.Console.WriteLine("Trocou Data Context!!!!!!!!!!!!");
      }
  }
  </code></pre>