Skip to content

[Windows-inflight/10.0.101] Fix Device test failing in the PR 37746 - #37960

Merged
kubaflo merged 1 commit into
dotnet:inflight/10.0.101from
devanathan-vaithiyanathan:fix-36430-failure
Aug 31, 2026
Merged

kubaflo merged 1 commit into
dotnet:inflight/10.0.101from
devanathan-vaithiyanathan:fix-36430-failure

Conversation

@devanathan-vaithiyanathan

Copy link
Copy Markdown
Contributor

Issue Details

On Windows, dynamically updating the content of a ContentPresenter can throw a System.ArgumentException when the content contains controls such as RefreshView or ScrollView.

This happens when a platform view is reused while it is still attached to its previous WinUI parent, causing a “PointerEventRouter object already has an owner” exception.

The initial fix detached the platform view from its previous parent, but some scenarios still failed because:

  • The logical content was not detached before creating the control-template platform tree.
  • ContentPanel.Content = null could leave stale children in CachedChildren.

Description of Change

Updated the Windows ContentViewHandler content-update flow to properly handle direct, templated, and empty content.

  • Detach the existing content before creating the template platform tree.
  • Added a RemoveFromParent helper to safely detach the incoming platform view without disconnecting its handler.
  • Clear ContentPanel.CachedChildren before assigning new content or when the content becomes null.

Issues Fixed

Fixes #37958

Fixed below test cases:
Control.DeviceTests:

  • ControlTemplateInitializesCorrectly
  • ControlTemplateCanBeReplacedCorrectly
  • ContentView updating it's ControlTemplate works
  • PropagateContextCorrectly

Core.DeviceTests:

  • Content Initializes Correctly
  • Content Updates Correctly
  • ContentIsSetInitially
  • WindowSupportsEmptyPage_Platform

@dotnet-policy-service dotnet-policy-service Bot added the partner/syncfusion Issues / PR's with Syncfusion collaboration label Aug 28, 2026
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
There may be pipelines that require an authorized user to comment /azp run to run.

@devanathan-vaithiyanathan devanathan-vaithiyanathan added community ✨ Community Contribution and removed partner/syncfusion Issues / PR's with Syncfusion collaboration labels Aug 28, 2026
@github-actions github-actions Bot added area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter platform/windows labels Aug 28, 2026
@Tamilarasan-Paranthaman Tamilarasan-Paranthaman added the partner/syncfusion Issues / PR's with Syncfusion collaboration label Aug 28, 2026
@kubaflo

kubaflo commented Aug 29, 2026 •

Copy link
Copy Markdown
Contributor

/azp run maui-pr-devicetests

@azure-pipelines

Copy link
Copy Markdown
No pipelines are associated with this pull request.

@azure-pipelines

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

@kubaflo

This comment has been minimized.

@github-actions github-actions Bot added the s/agent-review-in-progress AI review is currently running for this PR label Aug 30, 2026
@MauiBot

This comment has been minimized.

@MauiBot

This comment has been minimized.

@MauiBot MauiBot removed the s/agent-review-in-progress AI review is currently running for this PR label Aug 30, 2026
@kubaflo

This comment has been minimized.

@github-actions github-actions Bot added the s/agent-review-in-progress AI review is currently running for this PR label Aug 30, 2026
@MauiBot

This comment has been minimized.

@MauiBot

MauiBot commented Aug 30, 2026

Copy link
Copy Markdown
Collaborator

Warning

🔍 Automated review could not complete

A trusted setup or review stage could not finish before producing review artifacts. Common causes include a transient GitHub/CI API failure, a CI-agent failure, or a pre-existing break on the target branch; this notice does not identify a merge conflict in your change.

Please re-comment /review to retry on a fresh agent.

🔍 Automated message from the .NET MAUI Copilot reviewer pipeline · build log

@MauiBot MauiBot removed the s/agent-review-in-progress AI review is currently running for this PR label Aug 30, 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.

What's the status of this one? Is it ready for review?

@Ahamed-Ali Ahamed-Ali changed the title [Windows] Fix Device test failing in candidate PR 37393 [Windows-inflight/10.0.101] Fix Device test failing in the PR 37746 Aug 31, 2026
@sheiksyedm
sheiksyedm marked this pull request as ready for review August 31, 2026 06:31
This was referenced Sep 20, 2026

This branch was previously deployed

1 inactive deployment
copilot-pat-pool — 31900af6 Deployed Aug 28, 2026 by devanathan-vaithiyanathan via conclusion #1619
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration platform/windows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[inflight regression / Windows] Device test failing in candidate PR 37393

5 participants