You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
at System.Windows.Data.ListCollectionView.ValidateCollectionChangedEventArgs(NotifyCollectionChangedEventArgs e)
at System.Windows.Data.ListCollectionView.ProcessCollectionChanged(NotifyCollectionChangedEventArgs args)
at System.Collections.ObjectModel.ObservableCollection1.OnCollectionChanged(NotifyCollectionChangedEventArgs e) at System.Collections.ObjectModel.RangedObservableCollection1.AddRange(IEnumerable`1 collection) in D:...\RangedObservableCollection.cs:line
when I try
List<object> templist = new List<object>();
...
FilesCollection.AddRange(templist);
The text was updated successfully, but these errors were encountered:
Basically, you cannot call OnCollectionChanged because that would trigger a Range operation.
What you can do instead is loop through all handlers. If the handler is bound from a CollectionView, you can just call the Refresh() method on the CollectionView. Otherwise you can just invoke the handler.
I replaced my ObservableCollection with this one and I get
on line
OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, changedItems, startIndex));
Using WPF and .NET 4.8. Am I missing something?
Edit: more info:
Stack Trace
when I try
The text was updated successfully, but these errors were encountered: