title: WPF DataTemplate access to Resources within same ResourceDictionary
body: <p>Simplified, I have a ResourceDictionary which contains a DataTemplate and a ViewModel-Class.</p>
  
  <pre><code>&lt;ResourceDictionary&gt;
      &lt;DataTemplate DataType="Whatever"&gt;
          &lt;ListBox ItemsSource="{Binding Source={StaticResource MyViewModel}, Path=SomeGlobalData}" /&gt;
      &lt;/DataTemplate&gt;
  
      &lt;MyViewModelClass x:Key="MyViewModel" /&gt;
  &lt;/ResourceDictionary&gt;
  </code></pre>
  
  <p>Of course the Binding won't work (it'll fire exceptions) because the DataType won't have the resource 'MyViewModel'. But in the VisualTree the "thing" that gets DataTemplated is a child of an object which has the ResourceDictionary merged to its Resources, so there might be a way to access it within runtime.</p>
  
  <p>So my question is: Is there any clean way to access 'MyViewModel' within the DataTemplate?</p>