I’ve trying to build a user control that will display the content of a Dictionary
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
ie
public class MyCtrl<TKey,TValue> : UserControl
{
private Dictionary<TKey,TValue>
}
because it references a generated file in the .\Obj\Debug\MyCtrl.g.i.cs
which is read only
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?
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
You can use generic as if you don’t use XAML. But if you want to use XAML to define your control, you can’t use generic