[Windows] Fixed COMException when changing Image Aspect to Fill#34033
Draft
SubhikshaSf4851 wants to merge 1 commit intodotnet:mainfrom
Draft
[Windows] Fixed COMException when changing Image Aspect to Fill#34033SubhikshaSf4851 wants to merge 1 commit intodotnet:mainfrom
SubhikshaSf4851 wants to merge 1 commit intodotnet:mainfrom
Conversation
Contributor
|
Hey there @@SubhikshaSf4851! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
This was referenced Feb 13, 2026
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Note
Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!
Root Cause:
On Windows, changing the image AspectFill was triggering updates before the native PlatformView was fully loaded, causing a lifecycle timing issue that resulted in a COMException when accessing the underlying WinUI image control.
Description of Change
MapAspectmethod inImageHandler.Windows.csto check if thePlatformViewis loaded before updating the aspect, and to attach aLoadedevent handler (OnImageLoaded) if it is not yet loaded.Test Coverage Adjustments:
#if TEST_FAILS_ON_WINDOWSpreprocessor directive fromImageFeatureTests.cs, re-enabling tests for verifying image aspect with image sources from files and fonts on Windows. This change ensures these tests are now executed across all platforms, improving test coverage. [1] [2]Issues Fixed
Fixes #29812
Tested the behavior in the following platforms
BeforrFix29812.1.mp4
AfterFix29812.mp4