Skip to content

Revert "Fix ApplyToDerivedTypes not working for implicit styles (#9648)"#33397

Merged
PureWeen merged 6 commits intomainfrom
copilot/revert-pr-32711
Jan 8, 2026
Merged

Revert "Fix ApplyToDerivedTypes not working for implicit styles (#9648)"#33397
PureWeen merged 6 commits intomainfrom
copilot/revert-pr-32711

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jan 6, 2026

Description of Change

Reverts the changes from #32711 which modified how implicit styles with ApplyToDerivedTypes=true are applied.

The original behavior returns early with the first applicable implicit style instead of merging multiple styles from the type hierarchy.

Issues Fixed

Fixes #33203

Test Results

Maui33203 Tests (6/6 PASS):

  • ImplicitStyleWithBasedOnKeyedStyleWorks - All 3 inflators PASSED ✅
  • DerivedImplicitStyleOverridesBaseStyle - All 3 inflators PASSED ✅
Original prompt

Revert this PR #32711


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

…yles

Co-authored-by: PureWeen <5375137+PureWeen@users.noreply.github.com>
Copilot AI changed the title [WIP] Revert pull request 32711 Revert "Fix ApplyToDerivedTypes not working for implicit styles (#9648)" Jan 6, 2026
Copilot AI requested a review from PureWeen January 6, 2026 15:21
@PureWeen
Copy link
Copy Markdown
Member

PureWeen commented Jan 6, 2026

@copilot please add a note that this "Fixes #33203"

Use our standard template for the structure

@PureWeen PureWeen marked this pull request as ready for review January 6, 2026 16:03
Copilot AI review requested due to automatic review settings January 6, 2026 16:03
@PureWeen PureWeen added this to the .NET 10.0 SR2.1 milestone Jan 6, 2026
@PureWeen PureWeen moved this from Todo to Ready To Review in MAUI SDK Ongoing Jan 6, 2026
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Jan 6, 2026

@copilot please add a note that this "Fixes #33203"

Use our standard template for the structure

Updated the PR description to include "Fixes #33203" and restructured it using the standard template with "Description of Change" and "Issues Fixed" sections.

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 reverts the changes from PR #32711, which implemented style merging for implicit styles with ApplyToDerivedTypes=true across inheritance hierarchies. The revert restores the original behavior where only the most specific applicable implicit style is applied (early return on first match), rather than merging multiple styles from the type hierarchy.

Key Changes

  • MergedStyle.cs: Restored original OnImplicitStyleChanged() logic with early return behavior instead of complex style merging
  • Test deletion: Removed Maui9648.xaml and Maui9648.xaml.cs test files specific to the reverted feature
  • Benchmark deletion: Removed ImplicitStylesBenchmark.cs performance benchmarks

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
src/Controls/src/Core/MergedStyle.cs Reverted OnImplicitStyleChanged() to original implementation: returns on first applicable implicit style instead of collecting and merging multiple styles
src/Controls/tests/Xaml.UnitTests/Issues/Maui9648.xaml Deleted test XAML demonstrating multi-level implicit style merging
src/Controls/tests/Xaml.UnitTests/Issues/Maui9648.xaml.cs Deleted test code validating ApplyToDerivedTypes behavior with merged styles
src/Controls/tests/Xaml.Benchmarks/ImplicitStylesBenchmark.cs Deleted performance benchmarks for implicit style merging scenarios

@PureWeen
Copy link
Copy Markdown
Member

PureWeen commented Jan 6, 2026

@copilot can you grab the tests from #33218 ?

and then report back if they pass

Copilot AI and others added 2 commits January 6, 2026 21:48
Co-authored-by: PureWeen <5375137+PureWeen@users.noreply.github.com>
Co-authored-by: PureWeen <5375137+PureWeen@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Jan 6, 2026

@copilot can you grab the tests from #33218 ?

and then report back if they pass

Added tests from PR #33218 in commit 09cb402.

Test Results:

Test Result
ImplicitStyleWithBasedOnKeyedStyleWorks ✅ PASS (all 3 inflators)
DerivedImplicitStyleOverridesBaseStyle ✅ PASS (all 3 inflators)
DerivedStyleOverridesBaseAppThemeBinding ❌ FAIL (all 3 inflators)
DerivedStyleOverridesBaseAppThemeBindingInDarkMode ❌ FAIL (all 3 inflators)

Summary: 6/12 tests pass. The basic Maui33203 tests pass with the revert, confirming that BasedOn keyed styles work correctly. The Maui33203AppTheme tests fail because they require the additional AppThemeBinding.cs fix from PR #33218.

@PureWeen
Copy link
Copy Markdown
Member

PureWeen commented Jan 7, 2026

@copilot alright keep the tests that are passing and remove the ones that are failing

Co-authored-by: PureWeen <5375137+PureWeen@users.noreply.github.com>
Co-authored-by: PureWeen <5375137+PureWeen@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Jan 7, 2026

@copilot alright keep the tests that are passing and remove the ones that are failing

Done in commit 377d381. Removed the failing Maui33203AppTheme tests and kept the passing Maui33203 tests. All 6 remaining tests pass.

@rmarinho
Copy link
Copy Markdown
Member

rmarinho commented Jan 7, 2026

/azp run maui-pr-devicetests

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@github-project-automation github-project-automation Bot moved this from Ready To Review to Approved in MAUI SDK Ongoing Jan 7, 2026
@PureWeen
Copy link
Copy Markdown
Member

PureWeen commented Jan 7, 2026

/backport to release/10.0.1xx-sr2

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jan 7, 2026

Started backporting to release/10.0.1xx-sr2 (link to workflow run)

PureWeen added a commit that referenced this pull request Jan 7, 2026
…r implicit styles (#9648)" (#33414)

Backport of #33397 to release/10.0.1xx-sr2

/cc @PureWeen @Copilot

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: PureWeen <5375137+PureWeen@users.noreply.github.com>
@PureWeen
Copy link
Copy Markdown
Member

PureWeen commented Jan 7, 2026

/azp run maui-pr-uitests

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@PureWeen PureWeen merged commit 14b1175 into main Jan 8, 2026
161 checks passed
@github-project-automation github-project-automation Bot moved this from Approved to Done in MAUI SDK Ongoing Jan 8, 2026
@PureWeen PureWeen deleted the copilot/revert-pr-32711 branch January 8, 2026 23:38
@github-actions github-actions Bot locked and limited conversation to collaborators Feb 8, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

10.0.20 breaks implicit styles

5 participants