C# - What should I do when every inherited class needs getter from base class, but setter only for O
- by msfanboy
Hello,
I have a abstract class called WizardViewModelBase.
All my WizardXXXViewModel classes inherit from the base abstract class.
The base has a property with a getter. Every sub class needs and overrides that string
property as its the DisplayName of the ViewModel.
Only ONE ViewModel called WizardTimeTableWeekViewModel needs a setter because I have to set
wether the ViewModel is a timetable for week A or week B. Using 2 ViewModels like
WizardTimeTableWeekAViewModel and WizardTimeTableWeekBViewModel would be redundant.
I do not want to override the setter in all other classes as they do not need a setter.
Can I somehow tell the sub class it needs not to override the setter?
Or any other suggestion?
With interfaces I would be free to use getter or setter but having many empty setter
properties is not an option for me.