I am working on creating a base view model class. ViewModelBase is an abstract class, and I want to define the properties that I want all my other derived view models to implement.
One of the properties is ObservableCollection:
public abstract ObservableCollection<???> Items { get; set; }
In classes that are derived from this base class, different types of elements will be defined ( ObservableCollection<Person> , ObservableCollection<Car> ).
If I set the ObservableCollection type to object in ViewModelBase, I would need to do many different castings in derived classes to make it work.
Is this the right approach?
Flack source share