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

Implement AddOrUpdateRange method in ResourceDictionary #18354

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

StefanKoell
Copy link
Contributor

What does the pull request do?

This PR provides a new method to the ResourceDictionary called AddOrUpdateRange which allows to batch multiple updates in one go and notify all subscribers about the change at the very end once the resources have been updated.

See discussion: #18346

What is the current behavior?

At the moment, adding or updating existing resources are immediately notifying all subscribers about resource changes. In complex application this can become quite expensive and slow when your updating multiple (tens or hundreds) resources by code.

What is the updated/expected behavior with this PR?

When using the AddOrUpdateRange methods, the notification of all subscribers happens only once at the end of the method, regardless of the number of updates performed.

Checklist

Breaking changes

None.

Obsoletions / Deprecations

None.

Fixed issues

#18346

@maxkatz6 maxkatz6 added the needs-api-review The PR adds new public APIs that should be reviewed. label Mar 2, 2025
@MrJul MrJul added the feature label Mar 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature needs-api-review The PR adds new public APIs that should be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants