title: Using MEF, how to export a view for an ItemsControl?
body: <p><code>enter code here</code>Maybe the title is not so specific.</p>
  
  <p>The situation which I'm having is. I've got an <code>ItemsControl</code> where I insert many <code>ViewModels</code>, and this <code>ItemsControl</code> should have to show the <code>View</code> through <code>DataTemplates</code>.</p>
  
  <p>So, I write these in a <code>ResourceDictionary</code>:</p>
  
  <p><img src="https://i.stack.imgur.com/tRtgm.png" alt="enter image description here"></p>
  
  <p>And then, I add this <code>ResourceDictionary</code> to the <code>ApplicationResources</code>.</p>
  
  <p>This is so redundant and tiredsome.</p>
  
  <p>I'm using <code>MVVM</code> also, so I was thinking if could be a way to use MEF to discover the corresponding the <code>View</code> that should draw. I was investigating that creating a custom attribute tag could be a good idea to simplify these redundant code, maybe adding this tag in the view telling it that this <code>ViewModel</code> should draw for this View, but I get lost with MEF.</p>
  
  <p>The plan is to remove the <code>ResourceDictionary</code>.</p>
  
  <p>Can you lend me a little hand?</p>
  
  <p>Thanks in advance.</p>