Skip to content

[Windows] Fixed the EmptyView and EmptyViewTemplate issues in CollectionView#28472

Closed
Ahamed-Ali wants to merge 4 commits into
dotnet:mainfrom
Ahamed-Ali:fix-28334
Closed

[Windows] Fixed the EmptyView and EmptyViewTemplate issues in CollectionView#28472
Ahamed-Ali wants to merge 4 commits into
dotnet:mainfrom
Ahamed-Ali:fix-28334

Conversation

@Ahamed-Ali

Copy link
Copy Markdown
Contributor

Issue 1 : EmptyViewTemplate Not Displayed

Root Cause of the issue

  • The EmptyViewTemplate was not considered in the UpdateEmptyView method, causing it to be ignored.

Description of Change

  • The EmptyViewTemplate is 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

  • When EmptyView is selected first and ItemSource is later set to null, the UpdateItemsSource method returns early, preventing EmptyView from being updated.

Description of Change

  • Removed the return condition that caused UpdateItemsSource to exit early when ItemSource was null. Additionally, added necessary ItemSource checks in appropriate places to ensure proper handling and prevent crashes.

Issues Fixed

Fixes #28334

Tested the behaviour in the following platforms

  • Android
  • Windows
  • iOS
  • Mac

Screenshot

Before Issue Fix After Issue Fix
EmptyViewandEmptyViewTemplateIssue.mp4
EmptyViewandEmptyViewTemplatefix.mp4

@Ahamed-Ali Ahamed-Ali changed the title Fixed the EmptyView and EmptyViewTemplate issues in CollectionView [Windows] Fixed the EmptyView and EmptyViewTemplate issues in CollectionView Mar 18, 2025
@dotnet-policy-service dotnet-policy-service Bot added the community ✨ Community Contribution label Mar 18, 2025
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

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.

@dotnet-policy-service dotnet-policy-service Bot added the partner/syncfusion Issues / PR's with Syncfusion collaboration label Mar 18, 2025
@jsuarezruiz jsuarezruiz added area-controls-collectionview CollectionView, CarouselView, IndicatorView platform/windows labels Mar 19, 2025
@jsuarezruiz

Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 3 pipeline(s).

@Ahamed-Ali Ahamed-Ali marked this pull request as ready for review March 20, 2025 09:34
Copilot AI review requested due to automatic review settings March 20, 2025 09:34
@Ahamed-Ali Ahamed-Ali requested a review from a team as a code owner March 20, 2025 09:34

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@jsuarezruiz

Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 3 pipeline(s).

Comment thread src/Controls/tests/TestCases.HostApp/Issues/Issue28334.xaml.cs
@jsuarezruiz

Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 3 pipeline(s).

@jsuarezruiz jsuarezruiz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pending snapshots, already available in the latest build:
image
Could you commit the images?

@Ahamed-Ali

Copy link
Copy Markdown
Contributor Author

Pending snapshots, already available in the latest build: image Could you commit the images?

I have committed the pending images @jsuarezruiz

@jsuarezruiz

Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 3 pipeline(s).

@jsuarezruiz

Copy link
Copy Markdown
Contributor

/rebase

@jsuarezruiz

Copy link
Copy Markdown
Contributor

/azp run MAUI-UITests-public

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@MauiBot MauiBot added s/agent-changes-requested AI agent recommends changes - found a better alternative or issues s/agent-gate-passed AI verified tests catch the bug (fail without fix, pass with fix) s/agent-fix-win AI found a better alternative fix than the PR s/agent-reviewed PR was reviewed by AI agent workflow (full 4-phase review) labels Mar 22, 2026

@kubaflo kubaflo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please review the AI's summary?

@dotnet dotnet deleted a comment from MauiBot May 3, 2026
@dotnet dotnet deleted a comment from MauiBot May 3, 2026
@MauiBot

This comment has been minimized.

@kubaflo kubaflo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please resolve conflicts?

@kubaflo

kubaflo commented May 24, 2026

Copy link
Copy Markdown
Contributor

/review -b feature/refactor-copilot-yml

@MauiBot

This comment has been minimized.

@kubaflo

kubaflo commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

/review -b feature/enhanced-reviewer -p windows

@MauiBot

MauiBot commented Jun 6, 2026

Copy link
Copy Markdown
Collaborator

⚠️ Merge Conflict Detected — This PR has merge conflicts with its target branch. Please rebase onto the target branch and resolve the conflicts.

@kubaflo kubaflo added the stale Indicates a stale issue/pr and will be closed soon label Jun 15, 2026
@kubaflo

kubaflo commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

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! 🙏

@kubaflo

kubaflo commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Closing as a stale one - if this PR is still needed please open a new one :)

@kubaflo kubaflo closed this Jun 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-controls-collectionview CollectionView, CarouselView, IndicatorView community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration platform/windows s/agent-changes-requested AI agent recommends changes - found a better alternative or issues s/agent-fix-win AI found a better alternative fix than the PR s/agent-gate-passed AI verified tests catch the bug (fail without fix, pass with fix) s/agent-reviewed PR was reviewed by AI agent workflow (full 4-phase review) stale Indicates a stale issue/pr and will be closed soon

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Windows] EmptyViewTemplate not displayed when ItemsSource is set to Null

7 participants