On my Window DataContext I set to a ViewModel, then I set my grids ItemsSource to my ObservableCollection property. I instantiate the Window, and my gird is filled out with the correct data, to the binding is working.
Next I add 4 blank records, but I dont want them, so I clear my ObservableCollection and reload from Database, all is good, my ObservableCollection has now been reset with the correct data, the DataContext of my Window also show the correct amount of data, but the underlying source of the DataGrid shows an ItemSource with 0 records, even though it is bound to my collection.
Why is this? If I add/delete/change the data gets updated correctly and saved back to the database, but if I totally clear the collection and reload it my ItemSource never gets updated with the refreshed data from the database.
Any help would be appreciated. Thanks.