Michael
Michael

Reputation: 747

MVVM: Model inside another Model

I have a model called Events and a Model called Persons. Am I fine, when I include an ObservableCollection of the type Persons in the Event Model? Is this right MVVM? Do I need everywhere an NotifyPropertyChanged?

Upvotes: 1

Views: 332

Answers (2)

Pedro Angel
Pedro Angel

Reputation: 116

Will you display in the Events view the list of persons? if that is true then you are correct, that is MVVVM, remember the ViewModels stands between your Models and your Views, and need to satisfy the data and functional requirements of your View.

Upvotes: 0

fooser
fooser

Reputation: 852

Sounds fine to me. Have both your Event model and Person model implement INotifyPropertyChanged.

The front end can then be notified when the ObservableCollection changes and also be notified when properties on the Event and Person models change.

Upvotes: 1

Related Questions