Skip to content

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

Open
Ahamed-Ali wants to merge 4 commits intodotnet:mainfrom
Ahamed-Ali:fix-28334
Open

[Windows] Fixed the EmptyView and EmptyViewTemplate issues in CollectionView#28472
Ahamed-Ali wants to merge 4 commits intodotnet: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
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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).

@jsuarezruiz
Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 3 pipeline(s).

Copy link
Copy Markdown
Contributor

@jsuarezruiz jsuarezruiz left a comment

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
Copy link
Copy Markdown
Collaborator

MauiBot commented Mar 22, 2026

🤖 AI Summary

📊 Expand Full Review434c2d3 · Committed the pending snap
🔍 Pre-Flight — Context & Validation

Issue: #28334 - [Windows] EmptyViewTemplate not displayed when ItemsSource is set to Null
PR: #28472 - [Windows] Fixed the EmptyView and EmptyViewTemplate issues in CollectionView
Platforms Affected: Windows (primary); Android, iOS, Mac tested by author
Files Changed: 2 implementation, 16 test (snapshots + HostApp + SharedTests)

Key Findings

  • Issue [Windows] EmptyViewTemplate not displayed when ItemsSource is set to Null #28334 reports two Windows CollectionView bugs: (1) EmptyViewTemplate is not shown when ItemsSource is set to null; (2) EmptyView fails to appear when set before ItemsSource is cleared.
  • Root cause: UpdateItemsSource() had an early-return guard (if (Element.ItemsSource == null) return;) that prevented UpdateEmptyView() from being called after the source was nulled out.
  • Second root cause: UpdateEmptyView() did not check for EmptyViewTemplate before the switch on emptyView, so EmptyViewTemplate was only reached via the default: case (which requires emptyView != null).
  • PR fix: (a) Removes the early-return in UpdateItemsSource(); (b) Adds null-guard for itemsSource in CreateCollectionViewSource() (both base and grouped); (c) Rewrites UpdateEmptyView() to check emptyViewTemplate first before emptyView.
  • Inline review comment from jsuarezruiz requested coverage of re-adding ItemsSource after displaying the empty state — PR author addressed this.
  • Inline review comment on the grouped null guard was resolved; author confirmed null exception would occur without it.
  • The change to GroupableItemsViewHandler.Windows.cs guards against a null-source crash in the grouped path, which is a legitimate defensive fix.
  • No prior PRAgent review comment found in the PR that needs to be resumed.
  • Labels on PR: s/agent-changes-requested, s/agent-gate-passed, s/agent-fix-win (from a prior review cycle).

Fix Candidates

# Source Approach Test Result Files Changed Notes
PR PR #28472 Remove early return in UpdateItemsSource, add null guards in CreateCollectionViewSource (base + grouped), prioritize EmptyViewTemplate in UpdateEmptyView. ✅ PASSED (Gate) ItemsViewHandler.Windows.cs, GroupableItemsViewHandler.Windows.cs + tests Original PR fix

🔧 Fix — Analysis & Comparison

Fix Candidates

# Source Approach Test Result Files Changed Notes
1 try-fix (claude-opus-4.6) Keep early return in UpdateItemsSource, call UpdateEmptyViewVisibility() before returning; fix UpdateEmptyView to handle EmptyViewTemplate when EmptyView is null. ✅ PASS 1 file (ItemsViewHandler.Windows.cs) Minimal: no changes to CreateCollectionViewSource or GroupableItemsViewHandler
2 try-fix (claude-sonnet-4.6) Fix at mapper level: add UpdateEmptyViewVisibility() in MapItemsSource when ItemsSource == null; add EmptyViewTemplate priority block at top of UpdateEmptyView(). ✅ PASS 1 file (ItemsViewHandler.Windows.cs) No changes to CreateCollectionViewSource or GroupableItemsViewHandler; cleanest separation of concerns
3 try-fix (gpt-5.3-codex) Lazy empty-view materialization: trigger UpdateEmptyViewVisibility() from CleanUpCollectionViewSource() when ItemsSource is null; lazily realize EmptyViewTemplate inside UpdateEmptyViewVisibility(). ✅ PASS 1 file (ItemsViewHandler.Windows.cs) Required 2 iterations; more complex coupling between cleanup and visibility
4 try-fix (gpt-5.4, sub for gemini) Added dedicated UpdateEmptyViewTemplate() path for MapEmptyViewTemplate; used try/finally in UpdateItemsSource() to always call UpdateEmptyViewVisibility() while keeping null-source early return. ✅ PASS 1 file (ItemsViewHandler.Windows.cs) Clean try/finally approach; passed 3/3 first try
PR PR #28472 Remove early return entirely, add itemsSource is not null guards in CreateCollectionViewSource (base + grouped), prioritize EmptyViewTemplate first in UpdateEmptyView. ✅ PASSED (Gate) 2 files Original PR

Cross-Pollination

Model Round New Ideas? Details
claude-opus-4.6 2 Yes NEW IDEA: Push empty-state detection into FormsListView/FormsGridView (platform layer, reactive callbacks) — architectural overreach for this bug
claude-sonnet-4.6 2 No NO NEW IDEAS
gpt-5.3-codex 2 Yes NEW IDEA: Patch CarouselViewHandler null early-return — out of scope for Issue28334 tests
gpt-5.4 2 No NO NEW IDEAS

Exhausted: Yes (2/4 models said NO NEW IDEAS; 2 new ideas were out of scope or architectural overreach)
Selected Fix: Candidate #1 — simplest, most targeted: 1 file, ~6 lines, preserves original early-return intent, no ripple changes needed in CreateCollectionViewSource or GroupableItemsViewHandler


📋 Report — Final Recommendation

⚠️ Final Recommendation: REQUEST CHANGES

Phase Status

Phase Status Notes
Pre-Flight ✅ COMPLETE Issue #28334, PR #28472 context captured; 2 impl files + 16 test files changed
Gate ✅ PASSED Windows — tests fail without fix, pass with fix
Try-Fix ✅ COMPLETE 4 attempts, all 4 passing; best alternative identified
Report ✅ COMPLETE

Summary

PR #28472 correctly fixes both CollectionView bugs on Windows (EmptyViewTemplate not shown when ItemsSource is null; EmptyView not shown when set before ItemsSource is cleared). The gate tests pass. However, a simpler single-file alternative (Candidate #1) passes the same tests with fewer changes and no side-effect risk.

Root Cause

Two independent root causes:

  1. UpdateItemsSource() had an early return (if (Element.ItemsSource == null) return) that skipped UpdateEmptyViewVisibility() when ItemsSource was set to null.
  2. UpdateEmptyView() bailed out with if (emptyView == null) return before checking EmptyViewTemplate, so template-based empty views were never realized when only EmptyViewTemplate was set (without EmptyView).

Fix Quality

PR's approach removes the early return entirely and adds null-source guards in both CreateCollectionViewSource() (base class) and GroupableItemsViewHandler.Windows.cs. While functional, this is a broader change than necessary: the early return was not wrong conceptually (no need to build a CollectionViewSource for null data), it just needed to ensure empty view visibility was updated before exiting.

Best alternative (Candidate #1):

// UpdateItemsSource() — add one line before the early return
if (Element.ItemsSource == null)
{
+   UpdateEmptyViewVisibility();
    return;
}

// UpdateEmptyView() — widen the null guard and add template priority
var emptyViewTemplate = Element.EmptyViewTemplate;
-if (emptyView == null)
+if (emptyView == null && emptyViewTemplate == null)
{
    return;
}
+if (emptyViewTemplate is not null)
+{
+    _emptyView = RealizeEmptyViewTemplate(emptyView, emptyViewTemplate);
+}
else { /* original switch */ }

Why the alternative is better:

  • Touches 1 file vs 2 files in the PR
  • Preserves the early-return intent (don't build a CollectionViewSource for null ItemsSource)
  • Eliminates the need for defensive null guards in CreateCollectionViewSource() and GroupableItemsViewHandler
  • The default: RealizeEmptyViewTemplate(emptyView, null) fallback in the PR's UpdateEmptyView() passes null as the template — this is a minor regression compared to the original Element.EmptyViewTemplate reference; the alternative avoids this issue entirely by handling template-first
  • Simpler to reason about: fix is exactly at the two independent root causes

Test coverage: Three screenshot tests on Windows cover the three scenarios (EmptyView display, EmptyViewTemplate display, re-add ItemsSource). Tests are well-structured. Minor note: tests use [Order] attributes which creates inter-test state dependency — ideally each test would be fully independent, but this is a minor concern.

Requested change: Replace the PR's broader refactor with the targeted Candidate #1 fix:

  1. Revert GroupableItemsViewHandler.Windows.cs to original (remove the itemsSource is not null guard added there)
  2. In ItemsViewHandler.Windows.cs, restore the original early return in UpdateItemsSource() but add UpdateEmptyViewVisibility() before it
  3. In ItemsViewHandler.Windows.cs, restore CreateCollectionViewSource() to original (remove the itemsSource is not null guard)
  4. In UpdateEmptyView(), keep the template-priority logic but use the approach from Candidate [Draft] Readme WIP #1 (widen the guard + template-first block)

@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
Copy link
Copy Markdown
Contributor

@kubaflo kubaflo left a comment

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?

@MauiBot
Copy link
Copy Markdown
Collaborator

MauiBot commented Mar 29, 2026

🚦 Gate - Test Before and After Fix

📊 Expand Full Gate434c2d3 · Committed the pending snap

Gate Result: ✅ PASSED

Platform: WINDOWS · Base: main · Merge base: 720a9d4a

Test Without Fix (expect FAIL) With Fix (expect PASS)
🖥️ Issue28334 Issue28334 ✅ FAIL — 573s ✅ PASS — 461s
🔴 Without fix — 🖥️ Issue28334: FAIL ✅ · 573s
  Determining projects to restore...
  Restored D:\a\1\s\src\Graphics\src\Graphics\Graphics.csproj (in 23.4 sec).
  Restored D:\a\1\s\src\Graphics\src\Graphics.Win2D\Graphics.Win2D.csproj (in 23.49 sec).
  Restored D:\a\1\s\src\Essentials\src\Essentials.csproj (in 11.65 sec).
  Restored D:\a\1\s\src\Core\src\Core.csproj (in 20.18 sec).
  Restored D:\a\1\s\src\Controls\tests\TestCases.HostApp\Controls.TestCases.HostApp.csproj (in 8.33 sec).
  Restored D:\a\1\s\src\Core\maps\src\Maps.csproj (in 16.81 sec).
  Restored D:\a\1\s\src\Controls\src\Core\Controls.Core.csproj (in 29 ms).
  Restored D:\a\1\s\src\Controls\src\Xaml\Controls.Xaml.csproj (in 41 ms).
  Restored D:\a\1\s\src\Controls\Maps\src\Controls.Maps.csproj (in 13 ms).
  Restored D:\a\1\s\src\Controls\Foldable\src\Controls.Foldable.csproj (in 12 ms).
  Restored D:\a\1\s\src\BlazorWebView\src\Maui\Microsoft.AspNetCore.Components.WebView.Maui.csproj (in 29 ms).
  3 of 14 projects are up-to-date for restore.
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13684401
  Graphics -> D:\a\1\s\artifacts\bin\Graphics\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Graphics.dll
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13684401
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13684401
  Essentials -> D:\a\1\s\artifacts\bin\Essentials\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Essentials.dll
  Graphics.Win2D -> D:\a\1\s\artifacts\bin\Graphics.Win2D\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Graphics.Win2D.WinUI.Desktop.dll
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13684401
  Core -> D:\a\1\s\artifacts\bin\Core\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.dll
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13684401
  Maps -> D:\a\1\s\artifacts\bin\Maps\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Maps.dll
  Controls.BindingSourceGen -> D:\a\1\s\artifacts\bin\Controls.BindingSourceGen\Debug\netstandard2.0\Microsoft.Maui.Controls.BindingSourceGen.dll
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13684401
  Controls.Core -> D:\a\1\s\artifacts\bin\Controls.Core\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Controls.dll
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13684401
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13684401
  Controls.Foldable -> D:\a\1\s\artifacts\bin\Controls.Foldable\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Controls.Foldable.dll
  Microsoft.AspNetCore.Components.WebView.Maui -> D:\a\1\s\artifacts\bin\Microsoft.AspNetCore.Components.WebView.Maui\Debug\net10.0-windows10.0.19041.0\Microsoft.AspNetCore.Components.WebView.Maui.dll
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13684401
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13684401
  Controls.Xaml -> D:\a\1\s\artifacts\bin\Controls.Xaml\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Controls.Xaml.dll
  Controls.Maps -> D:\a\1\s\artifacts\bin\Controls.Maps\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Controls.Maps.dll
  Controls.TestCases.HostApp -> D:\a\1\s\artifacts\bin\Controls.TestCases.HostApp\Debug\net10.0-windows10.0.19041.0\win-x64\Controls.TestCases.HostApp.dll

Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:05:50.58
  Determining projects to restore...
  Restored D:\a\1\s\src\TestUtils\src\VisualTestUtils\VisualTestUtils.csproj (in 878 ms).
  Restored D:\a\1\s\src\TestUtils\src\UITest.NUnit\UITest.NUnit.csproj (in 1.95 sec).
  Restored D:\a\1\s\src\TestUtils\src\UITest.Core\UITest.Core.csproj (in 3 ms).
  Restored D:\a\1\s\src\TestUtils\src\VisualTestUtils.MagickNet\VisualTestUtils.MagickNet.csproj (in 4.56 sec).
  Restored D:\a\1\s\src\TestUtils\src\UITest.Appium\UITest.Appium.csproj (in 1.78 sec).
  Restored D:\a\1\s\src\TestUtils\src\UITest.Analyzers\UITest.Analyzers.csproj (in 12.17 sec).
  Restored D:\a\1\s\src\Controls\tests\CustomAttributes\Controls.CustomAttributes.csproj (in 5 ms).
  Restored D:\a\1\s\src\Controls\tests\TestCases.WinUI.Tests\Controls.TestCases.WinUI.Tests.csproj (in 11.9 sec).
  7 of 15 projects are up-to-date for restore.
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13684401
  Controls.CustomAttributes -> D:\a\1\s\artifacts\bin\Controls.CustomAttributes\Debug\net10.0\Controls.CustomAttributes.dll
  Graphics -> D:\a\1\s\artifacts\bin\Graphics\Debug\net10.0\Microsoft.Maui.Graphics.dll
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13684401
  Essentials -> D:\a\1\s\artifacts\bin\Essentials\Debug\net10.0\Microsoft.Maui.Essentials.dll
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13684401
  Core -> D:\a\1\s\artifacts\bin\Core\Debug\net10.0\Microsoft.Maui.dll
  Controls.Core.Design -> D:\a\1\s\artifacts\bin\Controls.Core.Design\Debug\net472\Microsoft.Maui.Controls.DesignTools.dll
  Controls.BindingSourceGen -> D:\a\1\s\artifacts\bin\Controls.BindingSourceGen\Debug\netstandard2.0\Microsoft.Maui.Controls.BindingSourceGen.dll
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13684401
  Controls.Core -> D:\a\1\s\artifacts\bin\Controls.Core\Debug\net10.0\Microsoft.Maui.Controls.dll
  UITest.Core -> D:\a\1\s\artifacts\bin\UITest.Core\Debug\net10.0\UITest.Core.dll
  VisualTestUtils -> D:\a\1\s\artifacts\bin\VisualTestUtils\Debug\netstandard2.0\VisualTestUtils.dll
  UITest.NUnit -> D:\a\1\s\artifacts\bin\UITest.NUnit\Debug\net10.0\UITest.NUnit.dll
  UITest.Appium -> D:\a\1\s\artifacts\bin\UITest.Appium\Debug\net10.0\UITest.Appium.dll
  VisualTestUtils.MagickNet -> D:\a\1\s\artifacts\bin\VisualTestUtils.MagickNet\Debug\netstandard2.0\VisualTestUtils.MagickNet.dll
  UITest.Analyzers -> D:\a\1\s\artifacts\bin\UITest.Analyzers\Debug\netstandard2.0\UITest.Analyzers.dll
  Controls.TestCases.WinUI.Tests -> D:\a\1\s\artifacts\bin\Controls.TestCases.WinUI.Tests\Debug\net10.0\Controls.TestCases.WinUI.Tests.dll
Test run for D:\a\1\s\artifacts\bin\Controls.TestCases.WinUI.Tests\Debug\net10.0\Controls.TestCases.WinUI.Tests.dll (.NETCoreApp,Version=v10.0)
VSTest version 18.0.1 (x64)

Starting test execution, please wait...
A total of 1 test files matched the specified pattern.
D:\a\1\s\artifacts\bin\Controls.TestCases.WinUI.Tests\Debug\net10.0\Controls.TestCases.WinUI.Tests.dll
NUnit Adapter 4.5.0.0: Test execution started
Running selected tests in D:\a\1\s\artifacts\bin\Controls.TestCases.WinUI.Tests\Debug\net10.0\Controls.TestCases.WinUI.Tests.dll
   NUnit3TestExecutor discovered 3 of 3 NUnit test cases using Current Discovery mode, Non-Explicit run
>>>>> 3/29/2026 11:05:48 PM FixtureSetup for Issue28334(Windows)
>>>>> 3/29/2026 11:05:58 PM EmptyViewShouldRenderProperly Start
>>>>> 3/29/2026 11:06:01 PM EmptyViewShouldRenderProperly Stop
>>>>> 3/29/2026 11:06:01 PM Log types: 
  Failed EmptyViewShouldRenderProperly [4 s]
  Error Message:
   VisualTestUtils.VisualTestFailedException : 
Snapshot different than baseline: EmptyViewShouldRenderProperly.png (0.82% difference)
If the correct baseline has changed (this isn't a a bug), then update the baseline image.
See test attachment or download the build artifacts to get the new snapshot file.

More info: https://aka.ms/visual-test-workflow

  Stack Trace:
     at VisualTestUtils.VisualRegressionTester.Fail(String message) in /_/src/TestUtils/src/VisualTestUtils/VisualRegressionTester.cs:line 162
   at VisualTestUtils.VisualRegressionTester.VerifyMatchesSnapshot(String name, ImageSnapshot actualImage, String environmentName, ITestContext testContext) in /_/src/TestUtils/src/VisualTestUtils/VisualRegressionTester.cs:line 123
   at Microsoft.Maui.TestCases.Tests.UITest.<VerifyScreenshot>g__Verify|13_0(String name, <>c__DisplayClass13_0&) in /_/src/Controls/tests/TestCases.Shared.Tests/UITest.cs:line 477
   at Microsoft.Maui.TestCases.Tests.UITest.VerifyScreenshot(String name, Nullable`1 retryDelay, Nullable`1 retryTimeout, Int32 cropLeft, Int32 cropRight, Int32 cropTop, Int32 cropBottom, Double tolerance, Boolean includeTitleBar) in /_/src/Controls/tests/TestCases.Shared.Tests/UITest.cs:line 309
   at Microsoft.Maui.TestCases.Tests.Issues.Issue28334.EmptyViewShouldRenderProperly() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue28334.cs:line 19
   at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args)
   at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)

>>>>> 3/29/2026 11:06:02 PM EmptyViewTemplateShouldRenderProperly Start
>>>>> 3/29/2026 11:06:04 PM EmptyViewTemplateShouldRenderProperly Stop
>>>>> 3/29/2026 11:06:04 PM Log types: 
  Failed EmptyViewTemplateShouldRenderProperly [2 s]
  Error Message:
   VisualTestUtils.VisualTestFailedException : 
Snapshot different than baseline: EmptyViewTemplateShouldRenderProperly.png (1.22% difference)
If the correct baseline has changed (this isn't a a bug), then update the baseline image.
See test attachment or download the build artifacts to get the new snapshot file.

More info: https://aka.ms/visual-test-workflow

  Stack Trace:
     at VisualTestUtils.VisualRegressionTester.Fail(String message) in /_/src/TestUtils/src/VisualTestUtils/VisualRegressionTester.cs:line 162
   at VisualTestUtils.VisualRegressionTester.VerifyMatchesSnapshot(String name, ImageSnapshot actualImage, String environmentName, ITestContext testContext) in /_/src/TestUtils/src/VisualTestUtils/VisualRegressionTester.cs:line 123
   at Microsoft.Maui.TestCases.Tests.UITest.<VerifyScreenshot>g__Verify|13_0(String name, <>c__DisplayClass13_0&) in /_/src/Controls/tests/TestCases.Shared.Tests/UITest.cs:line 477
   at Microsoft.Maui.TestCases.Tests.UITest.VerifyScreenshot(String name, Nullable`1 retryDelay, Nullable`1 retryTimeout, Int32 cropLeft, Int32 cropRight, Int32 cropTop, Int32 cropBottom, Double tolerance, Boolean includeTitleBar) in /_/src/Controls/tests/TestCases.Shared.Tests/UITest.cs:line 309
   at Microsoft.Maui.TestCases.Tests.Issues.Issue28334.EmptyViewTemplateShouldRenderProperly() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue28334.cs:line 28
   at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args)
   at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)

>>>>> 3/29/2026 11:06:04 PM ReAddItemSourceShouldRenderProperly Start
>>>>> 3/29/2026 11:06:05 PM ReAddItemSourceShouldRenderProperly Stop
  Passed ReAddItemSourceShouldRenderProperly [955 ms]
NUnit Adapter 4.5.0.0: Test execution complete
[xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v2.8.2+699d445a1a (64-bit .NET 10.0.0)
[xUnit.net 00:00:00.11]   Discovering: Controls.TestCases.WinUI.Tests
[xUnit.net 00:00:00.30]   Discovered:  Controls.TestCases.WinUI.Tests

Total tests: 3
     Passed: 1
     Failed: 2
Test Run Failed.
 Total time: 39.4459 Seconds

🟢 With fix — 🖥️ Issue28334: PASS ✅ · 461s
  Determining projects to restore...
  All projects are up-to-date for restore.
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13684401
  Graphics -> D:\a\1\s\artifacts\bin\Graphics\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Graphics.dll
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13684401
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13684401
  Essentials -> D:\a\1\s\artifacts\bin\Essentials\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Essentials.dll
  Graphics.Win2D -> D:\a\1\s\artifacts\bin\Graphics.Win2D\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Graphics.Win2D.WinUI.Desktop.dll
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13684401
  Core -> D:\a\1\s\artifacts\bin\Core\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.dll
  Controls.BindingSourceGen -> D:\a\1\s\artifacts\bin\Controls.BindingSourceGen\Debug\netstandard2.0\Microsoft.Maui.Controls.BindingSourceGen.dll
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13684401
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13684401
  Controls.Core -> D:\a\1\s\artifacts\bin\Controls.Core\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Controls.dll
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13684401
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13684401
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13684401
  Controls.Foldable -> D:\a\1\s\artifacts\bin\Controls.Foldable\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Controls.Foldable.dll
  Maps -> D:\a\1\s\artifacts\bin\Maps\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Maps.dll
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13684401
  Controls.Maps -> D:\a\1\s\artifacts\bin\Controls.Maps\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Controls.Maps.dll
  Microsoft.AspNetCore.Components.WebView.Maui -> D:\a\1\s\artifacts\bin\Microsoft.AspNetCore.Components.WebView.Maui\Debug\net10.0-windows10.0.19041.0\Microsoft.AspNetCore.Components.WebView.Maui.dll
  Controls.Xaml -> D:\a\1\s\artifacts\bin\Controls.Xaml\Debug\net10.0-windows10.0.19041.0\Microsoft.Maui.Controls.Xaml.dll
  Controls.TestCases.HostApp -> D:\a\1\s\artifacts\bin\Controls.TestCases.HostApp\Debug\net10.0-windows10.0.19041.0\win-x64\Controls.TestCases.HostApp.dll

Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:05:37.03
  Determining projects to restore...
  All projects are up-to-date for restore.
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13684401
  Graphics -> D:\a\1\s\artifacts\bin\Graphics\Debug\net10.0\Microsoft.Maui.Graphics.dll
  Controls.CustomAttributes -> D:\a\1\s\artifacts\bin\Controls.CustomAttributes\Debug\net10.0\Controls.CustomAttributes.dll
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13684401
  Essentials -> D:\a\1\s\artifacts\bin\Essentials\Debug\net10.0\Microsoft.Maui.Essentials.dll
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13684401
  Core -> D:\a\1\s\artifacts\bin\Core\Debug\net10.0\Microsoft.Maui.dll
  Controls.Core.Design -> D:\a\1\s\artifacts\bin\Controls.Core.Design\Debug\net472\Microsoft.Maui.Controls.DesignTools.dll
  Controls.BindingSourceGen -> D:\a\1\s\artifacts\bin\Controls.BindingSourceGen\Debug\netstandard2.0\Microsoft.Maui.Controls.BindingSourceGen.dll
  ##vso[build.updatebuildnumber]10.0.60-ci+azdo.13684401
  Controls.Core -> D:\a\1\s\artifacts\bin\Controls.Core\Debug\net10.0\Microsoft.Maui.Controls.dll
  UITest.Core -> D:\a\1\s\artifacts\bin\UITest.Core\Debug\net10.0\UITest.Core.dll
  UITest.Appium -> D:\a\1\s\artifacts\bin\UITest.Appium\Debug\net10.0\UITest.Appium.dll
  VisualTestUtils -> D:\a\1\s\artifacts\bin\VisualTestUtils\Debug\netstandard2.0\VisualTestUtils.dll
  UITest.NUnit -> D:\a\1\s\artifacts\bin\UITest.NUnit\Debug\net10.0\UITest.NUnit.dll
  VisualTestUtils.MagickNet -> D:\a\1\s\artifacts\bin\VisualTestUtils.MagickNet\Debug\netstandard2.0\VisualTestUtils.MagickNet.dll
  UITest.Analyzers -> D:\a\1\s\artifacts\bin\UITest.Analyzers\Debug\netstandard2.0\UITest.Analyzers.dll
  Controls.TestCases.WinUI.Tests -> D:\a\1\s\artifacts\bin\Controls.TestCases.WinUI.Tests\Debug\net10.0\Controls.TestCases.WinUI.Tests.dll
Test run for D:\a\1\s\artifacts\bin\Controls.TestCases.WinUI.Tests\Debug\net10.0\Controls.TestCases.WinUI.Tests.dll (.NETCoreApp,Version=v10.0)
VSTest version 18.0.1 (x64)

Starting test execution, please wait...
A total of 1 test files matched the specified pattern.
D:\a\1\s\artifacts\bin\Controls.TestCases.WinUI.Tests\Debug\net10.0\Controls.TestCases.WinUI.Tests.dll
NUnit Adapter 4.5.0.0: Test execution started
Running selected tests in D:\a\1\s\artifacts\bin\Controls.TestCases.WinUI.Tests\Debug\net10.0\Controls.TestCases.WinUI.Tests.dll
   NUnit3TestExecutor discovered 3 of 3 NUnit test cases using Current Discovery mode, Non-Explicit run
>>>>> 3/29/2026 11:13:33 PM FixtureSetup for Issue28334(Windows)
>>>>> 3/29/2026 11:13:42 PM EmptyViewShouldRenderProperly Start
>>>>> 3/29/2026 11:13:44 PM EmptyViewShouldRenderProperly Stop
  Passed EmptyViewShouldRenderProperly [2 s]
>>>>> 3/29/2026 11:13:44 PM EmptyViewTemplateShouldRenderProperly Start
>>>>> 3/29/2026 11:13:46 PM EmptyViewTemplateShouldRenderProperly Stop
>>>>> 3/29/2026 11:13:46 PM ReAddItemSourceShouldRenderProperly Start
  Passed EmptyViewTemplateShouldRenderProperly [1 s]
>>>>> 3/29/2026 11:13:46 PM ReAddItemSourceShouldRenderProperly Stop
  Passed ReAddItemSourceShouldRenderProperly [900 ms]
NUnit Adapter 4.5.0.0: Test execution complete
[xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v2.8.2+699d445a1a (64-bit .NET 10.0.0)
[xUnit.net 00:00:00.15]   Discovering: Controls.TestCases.WinUI.Tests
[xUnit.net 00:00:00.34]   Discovered:  Controls.TestCases.WinUI.Tests

Test Run Successful.
Total tests: 3
     Passed: 3
 Total time: 29.9108 Seconds

📁 Fix files reverted (3 files)
  • eng/pipelines/ci-copilot.yml
  • src/Controls/src/Core/Handlers/Items/GroupableItemsViewHandler.Windows.cs
  • src/Controls/src/Core/Handlers/Items/ItemsViewHandler.Windows.cs

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)

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