title: How to reference a local Property once the DataContext is set to an Ancestor win WPF/Xaml
body: <p>I have some UserControl fields which provide a textbox inside of a user control.  I'm referencing the UserControl as:</p>
  
  <pre><code>&lt;UserControl 
  DataContext="{Binding Path=DataContext, RelativeSource={RelativeSource AncestorType=UserControl}}" /&gt;
  </code></pre>
  
  <p>I'm setting it to this because my UserControls are in a view model that share some common commands, etc so I can bind those properties to my outer ViewModel:</p>
  
  <p></p>
  
  <p>This is working as desired.  The issue is that each UserControl has their own view model in order to track things like a Value property:</p>
  
  <pre><code>&lt;UserControl 
  IsInDesignMode="{Binding IsInDesignMode}" 
  Text="{Binding Value}" 
  DataContext="{Binding Path=DataContext, RelativeSource={RelativeSource AncestorType=UserControl}}" /&gt;
  </code></pre>
  
  <p>If I use:</p>
  
  <pre><code>&lt;UserControl 
  IsInDesignMode="{Binding IsInDesignMode, RelativeSource={RelativeSource AncestorType=UserControl}}" 
  ControlText="{Binding DataContext.Value}"  /&gt;
  </code></pre>
  
  <p>or </p>
  
  <pre><code>&lt;UserControl 
  IsInDesignMode="{Binding DataContext.IsInDesignMode, RelativeSource={RelativeSource AncestorType=UserControl}}" 
  ControlText="{Binding DataContext.Value}" 
   /&gt;
  </code></pre>
  
  <p>The ControlText binds properly to the UserControl's viewmodel's Value, so that seems like the right approach, but the IsInDesignMode won't bind to the same view/viewmodel as it does when I have the DataContext= from the first version.</p>