I defined my UI in xaml and below is my code:
It seems like your Model implement
ObservableCollection<MyHomeworkModel>.
Remove this Base class and it should work.
Edit:
Your need to change:
AddCourseCommand = new AddCourseCommand(this);
To
Download DelegateCommand
AddCourseCommand = new DelegateCommand(AddNewTab);
Edit:
You Cut your ViewModel from your UI. You Copy an Instance into your Command and than call on that Copy add. This is wrong and Property your Fault. I realy advice you to use DelegateCommand this will maybe fix it.
To your guess:
think I know why it's complaining. My Text property is is MyHomeworkModel not MyHomeworkViewModel...but why it's fine with me binding the header to the Header property in MyHomeworkModel ?
It is right that your Property is in MyHomeworkModel
and not in MyHomeworkViewModel
you Bind onto a List that contains MyHomeworkModel
s. Now is you add a new item your Binding will set in the Lowest level. In this case in your insance of MyHomeworkModel
and not in MyHomeworkViewModel