Hello,
I want to update collection after it was changed but I can't seem to get "away" from this exception:
Cannot change ObservableCollection during a CollectionChanged or PropertyChanged event.
Inside event handler I unsubscribe from Collection changed event before changing anything to prevent infinite loops and after changes are made i subscribe again to same event.
private void CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
{
data.CollectionChanged -= CollectionChanged;
data.Add("Item");
data.CollectionChanged += CollectionChanged;
}
I tried using Dispatcher to call data.Add("Item"), but no luck :(