-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
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). |
# Conflicts: # src/Controls/tests/TestCases.HostApp/Issues/Issue10645.cs # src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue10645.cs # src/Controls/tests/TestCases.WinUI.Tests/snapshots/windows/Issue10645Test.png
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.
screen shot for Issue10645Test is failing
@Foda can you check if we just need to update screen shot? or if something broke?
…pectFill (#17665) * Wrap Image with a container on Windows so that it is centered with AspectFill * Add ui test * Rename test files to correct issue * Update Issue10645.cs * Add files via upload * - fix namespace * - remove windows * Update ref image to remove titlebar --------- Co-authored-by: Javier Suárez <javiersuarezruiz@hotmail.com> Co-authored-by: Shane Neuville <shneuvil@microsoft.com> Co-authored-by: Mike Corsaro <mikecorsaro@microsoft.com>
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