-
Notifications
You must be signed in to change notification settings - Fork 2k
[Windows] Fixed Margin doesn't work inside CollectionView EmptyView #29897
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
+93
−0
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
d6f338c
Fixed Margin doesn't work inside CollectionView EmptyView
Dhivya-SF4094 c495154
Added snapshots for all platforms
Dhivya-SF4094 bcbb375
Added background color for StackLayout
Dhivya-SF4094 6135ee3
Updated snapshot for all platforms
Dhivya-SF4094 a4bc388
Addressed AI summary concern
Dhivya-SF4094 cf163b4
Added snapshot for iOS 26
Dhivya-SF4094 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
Binary file added
BIN
+28.7 KB
...ntrols/tests/TestCases.Android.Tests/snapshots/android/CheckEmptyViewMargin.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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| using System.Collections.ObjectModel; | ||
|
|
||
| namespace Maui.Controls.Sample.Issues; | ||
|
|
||
| [Issue(IssueTracker.Github, 8494, "Margin doesn't work inside CollectionView EmptyView", PlatformAffected.UWP)] | ||
|
|
||
| public class Issue8494 : ContentPage | ||
| { | ||
| Issue8494EmptyViewModel ViewModel; | ||
|
|
||
| public Issue8494() | ||
| { | ||
| ViewModel = new Issue8494EmptyViewModel(); | ||
| BindingContext = ViewModel; | ||
| var label = new Label | ||
| { | ||
| Text = "EmptyView should be laid out with respect to the Specified margin", | ||
| AutomationId = "EmptyViewDescriptionLabel", | ||
| }; | ||
|
|
||
| var emptyViewLayout = new StackLayout | ||
| { | ||
| Margin = new Thickness(40), | ||
| Background = Colors.Yellow, | ||
| Children = | ||
| { | ||
| new Label | ||
| { | ||
| Text = "EmptyView with Margin.", | ||
| BackgroundColor = Colors.Blue, | ||
| HorizontalTextAlignment = TextAlignment.Center, | ||
| }, | ||
| } | ||
| }; | ||
|
|
||
| var collectionView = new CollectionView | ||
| { | ||
| ItemsSource = ViewModel.ItemList, | ||
| BackgroundColor = Colors.Green, | ||
| EmptyView = emptyViewLayout, | ||
| }; | ||
|
|
||
| var grid = new Grid | ||
| { | ||
| RowDefinitions = | ||
| { | ||
| new RowDefinition { Height = GridLength.Auto }, | ||
| new RowDefinition { Height = GridLength.Star }, | ||
| } | ||
| }; | ||
|
|
||
| grid.Add(label, 0, 0); | ||
| grid.Add(collectionView, 0, 1); | ||
| Content = grid; | ||
| } | ||
| } | ||
|
|
||
| public class Issue8494EmptyViewModel | ||
| { | ||
| public ObservableCollection<string> ItemList { get; set; } | ||
|
|
||
| public Issue8494EmptyViewModel() | ||
| { | ||
| ItemList = new ObservableCollection<string>(); | ||
| } | ||
| } | ||
Binary file added
BIN
+16.9 KB
src/Controls/tests/TestCases.Mac.Tests/snapshots/mac/CheckEmptyViewMargin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions
21
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue8494.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,21 @@ | ||
| using NUnit.Framework; | ||
| using UITest.Appium; | ||
| using UITest.Core; | ||
|
|
||
| namespace Microsoft.Maui.TestCases.Tests.Issues; | ||
|
|
||
| public class Issue8494 : _IssuesUITest | ||
| { | ||
| public Issue8494(TestDevice testDevice) : base(testDevice) | ||
| { | ||
| } | ||
| public override string Issue => "Margin doesn't work inside CollectionView EmptyView"; | ||
|
|
||
| [Test] | ||
| [Category(UITestCategories.CollectionView)] | ||
| public void CheckEmptyViewMargin() | ||
| { | ||
| App.WaitForElement("EmptyViewDescriptionLabel"); | ||
| VerifyScreenshot(); | ||
| } | ||
| } |
Binary file added
BIN
+9.02 KB
...Controls/tests/TestCases.WinUI.Tests/snapshots/windows/CheckEmptyViewMargin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+35.2 KB
src/Controls/tests/TestCases.iOS.Tests/snapshots/ios-26/CheckEmptyViewMargin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+34.5 KB
src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/CheckEmptyViewMargin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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.