title: Associating a ViewModel to a View
body: <p>I have a main View and corresponding ViewModel. Because the main View is too complicated so I split it into many small Views; and each small View also has its own ViewModel.</p>
  
  <p>My question is that how to "associating a sub ViewModel to a sub View" in the main View?</p>
  
  <p>I am doing the following way, not sure if it is right or I have to use DataTemplate?</p>
  
  <pre><code>&lt;StackPanel&gt;
       &lt;local:SmallView-A DataContext="{x:Type local:SmallViewModel-A}" /&gt;
  &lt;/StackPanel&gt;
  &lt;StackPanel&gt;
      &lt;local:SmallView-B DataContext="{x:Type local:SmallViewModel-B}" /&gt;
  &lt;/StackPanel&gt;
  &lt;StackPanel&gt;
      &lt;local:SmallView-C DataContext="{x:Type local:SmallViewModel-C}" /&gt;
  &lt;/StackPanel&gt;
  </code></pre>