In my application, I have a BaseForm that has a common element in it:
public partial class BaseForm<T> : Form where T : Presenter { protected T Presenter; public BaseForm() { InitializeComponent(); } }
Now I need to have a form that is inherited from my BaseForm
public partial class SampleForm : BaseForm<SamplePresenter> { public SampleForm() { InitializeComponent(); Presenter = new SamplePresenter(); } }
The problem is that the Visual Studio designer is not showing my SampleForm retrieved from BaseForm<T> .
This is a warning:
Warning 1 A designer cannot be shown for this file, because none of the classes inside it can be designed. The designer checked the following classes in the file:
SampleForm --- The base class 'Invoice.BaseForm' cannot be loaded. Make sure that the assembly contains links and that all projects are built. 0 0
How can I overcome this?
PS I looked at this post , but I really did not understand the whole idea of โโhow to solve this.
generics inheritance c # visual-studio windows-forms-designer
Carmine
source share