Skip to content

Range actions are not supported Exception #1

@milos12345

Description

@milos12345

I replaced my ObservableCollection with this one and I get

System.NotSupportedException: 'Range actions are not supported.'

on line

OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, changedItems, startIndex));

Using WPF and .NET 4.8. Am I missing something?

Edit: more info:

Stack Trace

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);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions