Merge pull request #90 from erri120/fix/89

Fix incrementing `-1` indices
This commit is contained in:
Yoshifumi Kawai 2024-12-16 12:12:48 +09:00 committed by GitHub
commit 6f5de33bff
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -167,10 +167,12 @@ sealed class ObservableCollectionChanged<T>(IObservableCollection<T> collection,
eventArgs.Action,
item,
eventArgs.OldItem,
i++,
newStartingIndex: i,
eventArgs.OldStartingIndex,
eventArgs.SortOperation);
if (eventArgs.NewStartingIndex != -1) i++;
observer.OnNext(newArgs);
}
}