Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve AddRange implementation #1

Merged
merged 3 commits into from Apr 2, 2024

Conversation

dotMorten
Copy link
Contributor

@dotMorten dotMorten commented Apr 2, 2024

Avoid casts.
Correctly raise multi-item change event (must set changedItems with list of changes)
Ensure Count and Item[] properties are notified they change. See https://github.com/dotnet/runtime/blob/ef866615f9779f417103e9e8563d2201fe914b35/src/libraries/System.ObjectModel/src/System/Collections/ObjectModel/ObservableCollection.cs#L124-L125 for reference

@AndrewKeepCoding AndrewKeepCoding merged commit 6e25a4f into AndrewKeepCoding:main Apr 2, 2024
@dotMorten dotMorten deleted the patch-1 branch April 2, 2024 22:43
@AndrewKeepCoding
Copy link
Owner

@dotMorten Thanks for the fix!
Let's hope AddRange support is implemented on .NET 9 (or later?) 🤞dotnet/runtime#18087.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants