title: Changing the View for a ViewModel
body: <p>I am trying to implement the MVVM design patern for mt WPF application. In order to connect the view to the viewmodels, I use a <code>ResourceDictionary</code> (used in <code>Application.Resources</code>), that looks like</p>
  
  <pre><code>&lt;DataTemplate DataType={x:Type viewmodel:SampleViewModel}&gt;
      &lt;view:SampleView1 /&gt;
  &lt;/DataTemplate&gt;
  </code></pre>
  
  <p>The view models are then simply put into content presenters to display them.</p>
  
  <p>Now, when the user presses a button, I'd like to display <code>SampleViewModel</code> using a different view. How do I change the data template used for <code>SampleViewModel</code>?</p>