-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Wrap Image with a container on Windows so that it is centered with AspectFill #17665
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
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
9277b5d
Wrap Image with a container on Windows so that it is centered with As…
japarson aebc65b
Add ui test
japarson 5ea1847
Rename test files to correct issue
japarson 25fee2c
Update Issue10645.cs
japarson d6f40dd
Add files via upload
japarson 04ff602
Merge branch 'main' into dev/japarson/10645
jsuarezruiz 8a122f9
Merge branch 'main' into dev/japarson/10645
PureWeen 279f9ec
- fix namespace
PureWeen 51ac17c
- remove windows
PureWeen 117ea8f
Update ref image to remove titlebar
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using Microsoft.Maui.Controls; | ||
|
||
namespace Maui.Controls.Sample.Issues | ||
{ | ||
[Issue(IssueTracker.Github, 10645, "Image is not centered in AspectFill mode", PlatformAffected.UWP)] | ||
public class Issue10645 : TestContentPage | ||
{ | ||
protected override void Init() | ||
{ | ||
Content = | ||
new Grid() | ||
{ | ||
new Image() | ||
{ | ||
AutomationId = "AspectFillImage", | ||
Aspect = Microsoft.Maui.Aspect.AspectFill, | ||
WidthRequest = 100, | ||
HeightRequest = 200, | ||
Source = "dotnet_bot.png", | ||
} | ||
}; | ||
} | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue10645.cs
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#if WINDOWS | ||
using NUnit.Framework; | ||
using UITest.Appium; | ||
using UITest.Core; | ||
|
||
namespace Microsoft.Maui.TestCases.Tests.Issues | ||
{ | ||
public class Issue10645 : _IssuesUITest | ||
{ | ||
public Issue10645(TestDevice device) : base(device) | ||
{ | ||
} | ||
|
||
public override string Issue => "Image is not centered in AspectFill mode"; | ||
|
||
[Test] | ||
[Category(UITestCategories.ActionSheet)] | ||
public void Issue10645Test() | ||
{ | ||
App.WaitForElement("AspectFillImage", timeout: TimeSpan.FromSeconds(4)); | ||
|
||
VerifyScreenshot(); | ||
} | ||
} | ||
} | ||
#endif |
Binary file added
BIN
+24.2 KB
src/Controls/tests/TestCases.WinUI.Tests/snapshots/windows/Issue10645Test.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.