We once worked with WinForm and we had a certain class:
class City { public int ID {get;set;} public string Name {get;set;} public List<Area> {get;set;} .... } Then we learned about WPF and decided to go for it. But if it is WPF, then you need to do everything according to the canon (that is, using MVVM) and you should make a ViewModel. Duck here I get lost. How to do it better? To finalize the very same City class is to make it INotifyPropertyChanged (In this case, replace the collections with ObservableCollection ), but then we have the Model and ViewModel merged together? Not good, or good ?. Or create a ViewModel for it:
class CityViewModel : INotyPropertyCjanged { private City _city; public int ID { get {return _city.ID; } set {_city.ID = value; RaisePropertyChanged("ID");} } ... } But what then to do with List<Area> ? How to pack it in ObservableCollection ?
Please direct the true path ... Examples are welcome!
UPD
And until I forgot. Suppose we need to fill our model with data from, for example, databases. Where should the data retrieval function be located? In ViewModel or View or else where?