title: How to set the DataContext for a View created in DataTemplate from ViewModel
body: <p>There are questions on this already, but they don't answer my question.
  For example:</p>
  
  <pre><code> &lt;ContentControl.Resources&gt;
              &lt;DataTemplate DataType="{x:Type Databinding:RedScreenViewModel}" &gt;
                  &lt;Databinding:RedScreen DataContext="{Binding}"/&gt;
              &lt;/DataTemplate&gt;
              &lt;DataTemplate DataType="{x:Type  Databinding:BlueScreenViewModel}"&gt;
                  &lt;Databinding:BlueScreen DataContext="{Binding}" /&gt;
              &lt;/DataTemplate&gt;
   &lt;/ContentControl.Resources&gt;
  </code></pre>
  
  <p>As you can see I am attempting to set the DataContext for the created View hoping that it would use the ViewModel that was used to create it. But when I step through the code behind.. the DataContext is always null. How can I achieve what I want?
  Thanks </p>