title: WPF Relative source- Cannot find source for binding with reference
body: <p>have you ever have a problem like this:</p>
  
  <pre><code>System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.UserControl', AncestorLevel='1''. BindingExpression:Path=DataContext; DataItem=null; target element is 'ContextMenu' (Name=''); target property is 'DataContext' (type 'Object')
  </code></pre>
  
  <p>Code:</p>
  
  <pre><code>&lt;ContextMenu DataContext="{Binding Path=DataContext, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type UserControl}}}" 
  </code></pre>
  
  <p>Context Menu is in the:</p>
  
  <pre><code>ListBox-&gt; ListBoxItemTemplate -&gt; DataGrid -&gt; DataGrid.ContextMenu
  </code></pre>
  
  <p>I have also another Binding in ListBox control, that works with no problems at all.</p>