I am having some strange problems with my ObservableCollection. I am using .Net 4.0.
I have a viewmodel like this:
PoViewModel : DataViewModelBase
{
public ObservableCollection<PoDetail> PoDetails { <omitting dp boiler code for ease> }
public void Add()
{
this.PoDetails.Add(new PoDetail()); //<-- this is not getting detected in the wpf UI
}
}
DataViewModelBase is a DependencyObject
I have this bit of test code that is verifying nothing is happening:
protected override void OnPropertyChanged(DependencyPropertyChangedEventArgs e)
{
base.OnPropertyChanged(e);
this.IsDirty = true;
MessageBox.Show(e.Property.Name + " just changed");
}
What could be the problem? I am assuming I don't understand how ObservableCollections work but from everything I have read this should be working fine.