title: C# Generic User Control WPF
body: <p>I've trying to build a user control that will display the content of a Dictionary</p>
  
  <p>the problem is i don't know the types for the key and value in the User control, i would know at the point i create the user control but C# doesn't seem to want to let me create a Generic User Control that would let me pass them in to a hosted dictionary</p>
  
  <p>ie</p>
  
  <pre><code>public class MyCtrl&lt;TKey,TValue&gt; : UserControl
  {
      private Dictionary&lt;TKey,TValue&gt;
  }
  </code></pre>
  
  <p>because it references a generated file in the .\Obj\Debug\MyCtrl.g.i.cs
  which is read only</p>
  
  <p>the only solution that is presenting itself to me is to create the class from scratch and not letting the designer handle any of the formatting is there a better possiblity?</p>
  
  <p>to give a little background in about 8-10 places in my code i need the user to populate dictionaries of values and instead of building 8-10 controls that all do exactly the same thing but with different Types (in fact a lot of the time the only difference is which enum is serving as the key) i wanted a single control to handle this</p>