I have a base winform and 2 derived winforms. The base winform contains labels, textboxes and a save button. Each derived class contains additional labels and textboxes. The SaveButton_Click event is calling to a Save method. I defined the Save method as abstract in the base class therefore I am also defining the base winform as abstract.
Here is my code:
public abstract partial class BaseRowInfo : Form
{
public BaseRowInfo()
{
InitializeComponent();
}
private void SaveButton_Click(object sender, EventArgs e)
{
Save();
}
protected abstract void Save();
}
public partial class EditableRowInfoFrm : BaseRowInfo
{
public EditableRowInfoFrm():base()
{
InitializeComponent();
}
protected override void Save()
{
// TODO
}
}
public partial class ReadOnlyRowInfoFrm : BaseRowInfo
{
public ReadOnlyRowInfoFrm ():base()
{
InitializeComponent();
}
protected override void Save()
{
// TODO
}
}
Once I am defining the base class as abstract, I do not have anymore the ability to edit the UI of the derived forms. Does the fact that I am defining the Base Class as abstract is wrong? What is the solution in case it is acceptable to define it as abstract?