Wrap Image with a container on Windows so that it is centered with AspectFill#17665
Merged
Conversation
emaf
previously approved these changes
Oct 6, 2023
hartez
suggested changes
Oct 6, 2023
PureWeen
reviewed
Oct 9, 2023
Member
|
/rebase |
a14676e to
cf1b0aa
Compare
Member
|
For now let's just merge this without the updated extensions. |
Contributor
|
/rebase |
Contributor
|
@japarson Could you please resolve conflicts and add a UI test? Thanks! |
cf1b0aa to
4bcd85b
Compare
Contributor
Author
|
/rebase |
c5068cb to
d6f40dd
Compare
Contributor
Author
jsuarezruiz
reviewed
May 13, 2024
Contributor
There was a problem hiding this comment.
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).
Contributor
|
/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
PureWeen
previously approved these changes
Aug 16, 2024
PureWeen
approved these changes
Aug 20, 2024
Redth
pushed a commit
that referenced
this pull request
Aug 22, 2024
…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>
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.
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 aContainerViewto the WindowsImageHandler.Before
After
Issues Fixed
Fixes #10645
Copied from #15122
Depends on