I want to have an abstract base class for some of my custom UserControl . . The reason is obvious: they have common properties and methods (the main implementation of some interface elements in fact), and I want to implement them only once.
I did this by defining my abstract base class:
public abstract class ViewBase : UserControl, ISomeInterface
Then I decided to implement one of my views, as usual, using the constructor:
public partial class SpecialView : UserControl
So far, everything is fine. Now I am replacing the output of my SpecialView class SpecialView abstract base class:
public partial class SpecialView : ViewBase
Now the designer in Visual Studio 2008 no longer works by stating: The designer must create an instance of type 'ViewBase' but it cannot because the type is declared as abstract.
How can I get around this? I just don't want the same code to be copied for all of these views.
Information: a question with virtual methods instead of abstract classes, but for me there is no suitable solution.
source share