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
Wrap Image with a container on Windows so that it is centered with AspectFill #17665
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to resolve our design discussion about how to handle remapping within Core before we can merge this. Scheduled a meeting, we'll update this as soon as we figure it out.
/rebase |
a14676e
to
cf1b0aa
Compare
For now let's just merge this without the updated extensions. |
/rebase |
@japarson Could you please resolve conflicts and add a UI test? Thanks! |
cf1b0aa
to
4bcd85b
Compare
/rebase |
c5068cb
to
d6f40dd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the changes in the UI Test runner, we need to regenerate the snapshot (now navigates directly to the issue page, and the NavigationBar will no be rendered).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Running a new build.
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
Description of Change
On Windows, we use Microsoft.UI.Xaml.Controls.Image which has a stretch property. When this property is set in WinUI, the image will not be centered. According to the WinUI team, this is intended behavior:
As you can see in the screenshot above, one workaround we can utilize is to wrap the image in a
Grid
. Luckily, we can utilize the existing WrapperView on Windows by adding aContainerView
to the WindowsImageHandler
.Before
After
Issues Fixed
Fixes #10645
Copied from #15122
Depends on