Difference between Model and ViewModel

Viewed 7370

I've never used MVVM before, so I'm probably missing something obvious. When I create a new Panorama application, there's already a ViewModel folder containing ItemViewModel and MainViewModel.

I thought "MainViewModel.cs" is the file that organizes the panorama. However, within MainViewModel, it has this line:

public MainViewModel()
{
    this.Items = new ObservableCollection<ItemViewModel>();
}

The ItemViewModel has no interaction with the panorama. These are the then instantiated like this:

this.Items.Add(new ItemViewModel() 
{ 
    LineOne = "first line", 
    LineTwo = "second line", 
    LineThree = "third line" 
});

Why isn't ItemViewModel just a 'Model'? It implements INotifyPropertyChanged, but for what purpose? I would've thought that the ObservableCollection in MainViewModel would be enough to notify any changes, as demonstrated here

3 Answers
Related