Fix ListView no longer displays images (servicing)#4222
Merged
RussKie merged 1 commit intodotnet:release/5.0from Nov 20, 2020
Merged
Fix ListView no longer displays images (servicing)#4222RussKie merged 1 commit intodotnet:release/5.0from
ListView no longer displays images (servicing)#4222RussKie merged 1 commit intodotnet:release/5.0from
Conversation
(cherry picked from commit d0608e7)
JeremyKuhne
approved these changes
Nov 17, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
(cherry picked from commit d0608e7)
Fixes #4169
Proposed changes
Changes in
ImageListownership model in #3601 means that very are now two instances of imagelists - one instance is tracked by Windows Forms (i.e. managed) side, and another one tracked by the underlying Win32 (unmanaged) side. This was done due to an observed ownership disconnect between the managed and unmanaged code, that led to situations where the unmanaged code would effectively destroy and instance of an imagelist, which the managed code was oblivious to.However with the above change changes to images in an imagelist on the managed side, i.e. a user adding or replacing an image in the imagelist, would not be reflected in the imagelist on the unmanaged side, and thus would not be reflected in the UI (which is drawn by the Win32).
The fix reuses the established infrastructure that notifies the managed imagelist implementation of changes to the images collection, and once a notification of a chance is received, the unmanaged imagelist is re-created, thus ensuring the UI has all the correct images to display.
Customer Impact
ImageListthat gets its images dynamically modified will render the images correctly.Regression?
Risk
Microsoft Reviewers: Open in CodeFlow