title: Access the ressource of the View from the viewmodel WPF MVVM
body: <p>I have a View with a DataTemplate</p>
  
  <pre><code>&lt;UserControl.Resources&gt;
          &lt;DataTemplate x:Key="TrackChangeTemplate"&gt;
                      &lt;TextBlock Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Content}"  /&gt;
          &lt;/DataTemplate&gt;
      &lt;/UserControl.Resources&gt;
  </code></pre>
  
  <p>and i want in the View :</p>
  
  <pre><code> SimpleLink link = new SimpleLink();
      link.Detail = (DataTemplate)Resources["TrackChangeTemplate"];
      link.DetailCount = 1;
      link.CreateDocument(true);
  </code></pre>
  
  <p>However i can't access the Resouces :
  (DataTemplate)Resources["TrackChangeTemplate"]; Resources is not known</p>
  
  <p>John</p>