I have a UserControl that exposes a System.Type property. I want to make it settable at design time, like the BindingSource’s DataSource property. Ultimately, I would like the designer code to generate this:
this.EntityType = typeof(Company.Product.Class);
Where the class selection would come from the project’s registered Data Sources.
Right now I’m exposing a BindingSource directly for the effect, but I’d love to know how can I replicate its behavior for my control.
This post helped me with this same type of problem.
Visual Studio Design Time Property – Form List Drop Down
This is my implementation, it creates a drop down of types that are accessible from the current project, and filters them by their base class.
You have to add a reference to EnvDTE