System.InvalidOperationException 'n' index in collection change event is not valid for collection of size '0'
问题 I'm getting this exception when triggering a CollectionChanged event on a custom implementation of INotifyCollectionChanged: An exception of type 'System.InvalidOperationException' occurred in PresentationFramework.dll but was not handled in user code Additional information: '25' index in collection change event is not valid for collection of size '0'. A XAML Datagrid is bound to the collection as ItemsSource. How can this exception occurrence be avoided? The code follows: public class