[Windows] Fixed the EmptyView and EmptyViewTemplate issues in CollectionView#28472
[Windows] Fixed the EmptyView and EmptyViewTemplate issues in CollectionView#28472Ahamed-Ali wants to merge 4 commits into
Conversation
|
Hey there @Ahamed-Ali! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
There was a problem hiding this comment.
Pull Request Overview
This PR fixes two issues related to the EmptyView and EmptyViewTemplate in CollectionView on Windows by ensuring that EmptyViewTemplate is correctly handled and that EmptyView is updated even when ItemsSource is null.
- Removed the early return for null ItemsSource to allow empty view updates.
- Updated the EmptyView and EmptyViewTemplate logic in ItemsViewHandler.Windows.cs.
- Added new automated tests in both TestCases.Shared.Tests and TestCases.HostApp to verify the fixes.
Reviewed Changes
Copilot reviewed 13 out of 14 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue28334.cs | Introduces new tests for EmptyView and EmptyViewTemplate behavior. |
| src/Controls/tests/TestCases.HostApp/Issues/Issue28334.xaml.cs | Adds UI test logic to trigger and verify the corrected EmptyView/Template behavior. |
| src/Controls/src/Core/Handlers/Items/ItemsViewHandler.Windows.cs | Modifies the update logic for ItemsSource and EmptyView to handle null ItemsSource and incorporate EmptyViewTemplate. |
| src/Controls/tests/TestCases.HostApp/Issues/Issue25224.xaml.cs | Improves data template selection logic with proper type checking for string items. |
| src/Controls/src/Core/Handlers/Items/GroupableItemsViewHandler.Windows.cs | Updates guard clauses in CreateCollectionViewSource to ensure itemsSource is valid before using it. |
Files not reviewed (1)
- src/Controls/tests/TestCases.HostApp/Issues/Issue28334.xaml: Language not supported
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
I have committed the pending images @jsuarezruiz |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
/rebase |
3a235f4 to
434c2d3
Compare
|
/azp run MAUI-UITests-public |
|
Azure Pipelines successfully started running 1 pipeline(s). |
kubaflo
left a comment
There was a problem hiding this comment.
Could you please review the AI's summary?
This comment has been minimized.
This comment has been minimized.
kubaflo
left a comment
There was a problem hiding this comment.
Could you please resolve conflicts?
|
/review -b feature/refactor-copilot-yml |
This comment has been minimized.
This comment has been minimized.
|
/review -b feature/enhanced-reviewer -p windows |
|
|
|
Marking this PR as stale — there has been no author activity for ~425 days (last push over a year ago) and it has unresolved review feedback / remains WIP. If you're still interested in landing this, please rebase on the latest target branch and address the outstanding comments, and we'll be happy to pick the review back up. Otherwise it may be closed to keep the PR queue manageable. Thanks for the contribution! 🙏 |
|
Closing as a stale one - if this PR is still needed please open a new one :) |


Issue 1 : EmptyViewTemplate Not Displayed
Root Cause of the issue
EmptyViewTemplatewas not considered in theUpdateEmptyViewmethod, causing it to be ignored.Description of Change
EmptyViewTemplateis now correctly handled to ensure it is displayed when appropriate.Issue 2: EmptyView Not Displayed Properly When Selected First and Then ItemSource is Set to Null
Root Cause of the issue
UpdateItemsSourcemethod returns early, preventingEmptyViewfrom being updated.Description of Change
Issues Fixed
Fixes #28334
Tested the behaviour in the following platforms
Screenshot
EmptyViewandEmptyViewTemplateIssue.mp4
EmptyViewandEmptyViewTemplatefix.mp4