title: DataTemplate in Resource sets ViewModel to View, but then
body: <p>I am trying to figure the many different ways of setting datacontext of a view to a viewmodel.</p>
  
  <p>One I'm oggling at this moment goes something like this:</p>
  
  <p>I have my MainWindowResource:</p>
  
  <pre><code>&lt;ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                  xmlns:vw="clr-namespace:DemoStuffPartII.View"
                  xmlns:vm="clr-namespace:DemoStuffPartII.ViewModel"&gt;
  
  &lt;DataTemplate DataType="{x:Type vm:PersonViewModel}"&gt;
      &lt;vw:PersonView /&gt;
  &lt;/DataTemplate&gt;
  </code></pre>
  
  <p></p>
  
  <p>But that's also immediately where I strand. I know that I should use a ContentControl in the View. But what is the best way to configure it? How to go about this?</p>