Skip to content

Disable AppThemeBinding source generation for .NET 10#33219

Merged
PureWeen merged 4 commits intomainfrom
copilot/apply-pull-requests-33101-33107
Dec 22, 2025
Merged

Disable AppThemeBinding source generation for .NET 10#33219
PureWeen merged 4 commits intomainfrom
copilot/apply-pull-requests-33101-33107

Conversation

Copy link
Contributor

Copilot AI commented Dec 18, 2025

Original prompt

Please apply the changes from #33101 and #33107 to the main branch


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

Copilot AI and others added 2 commits December 18, 2025 17:33
Co-authored-by: PureWeen <5375137+PureWeen@users.noreply.github.com>
Co-authored-by: PureWeen <5375137+PureWeen@users.noreply.github.com>
Copilot AI changed the title [WIP] Apply changes from PR 33101 and PR 33107 to main branch Disable AppThemeBinding source generation for .NET 10 Dec 18, 2025
Copilot AI requested a review from PureWeen December 18, 2025 17:50
@@ -0,0 +1 @@
{"version":3,"file":"HybridWebView.js","sourceRoot":"","sources":["HybridWebView.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoDH,CAAC;IAEG,4DAA4D;IAC5D,IAAI,mBAAmB,GAAoC,IAAI,CAAC;IAEhE;;;OAGG;IACH,SAAS,iBAAiB;QACtB,SAAS,4BAA4B,CAAC,OAAY;YAC9C,IAAM,KAAK,GAAG,IAAI,WAAW,CAAC,8BAA8B,EAAE,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,CAAC,CAAC;YAChG,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QAChC,CAAC;QAED,yEAAyE;QACzE,IAAI,MAAM,CAAC,MAAM,IAAI,MAAM,CAAC,MAAM,CAAC,OAAO,IAAI,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,gBAAgB,EAAE,CAAC;YACnF,mBAAmB;YACnB,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,gBAAgB,CAAC,SAAS,EAAE,UAAC,GA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8B,CAAC,MAAM,EAAE,IAAE,CAAC,CAAC;;;;;;KAElD;IAED,sDAAsD;IACtD,IAAM,aAAa,GAAG;QAClB,cAAc,EAAE,cAAc;QAC9B,YAAY,EAAE,YAAY;QAC1B,kBAAkB,EAAE,gBAAgB;KACvC,CAAC;IAEF,2EAA2E;IAC3E,uDAAuD;IACvD,MAAM,CAAC,eAAe,CAAC,GAAG,aAAa,CAAC;IAExC,+BAA+B;IAC/B,iBAAiB,EAAE,CAAC;AAExB,CAAC,CAAC,EAAE,CAAC"} No newline at end of file
Copy link
Member

Choose a reason for hiding this comment

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

@copilot revert the changes to this file

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Reverted in 8ec798c

Co-authored-by: PureWeen <5375137+PureWeen@users.noreply.github.com>
Copy link
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 backports changes from PRs #33101 and #33107 to the main branch, disabling AppThemeBinding source generation for .NET 10 while preparing for .NET 11. The changes use conditional compilation (#if NET11_0_OR_GREATER) to make AppThemeBinding features available only in .NET 11+, while maintaining backward compatibility with .NET 10.

Key changes:

  • AppThemeBinding class and AppThemeResource constant made public only for NET 11+
  • AppThemeBindingHelpers source generation removed entirely
  • AppThemeBinding markup extension support conditioned on NET 11+
  • Object initializer syntax replaces helper method calls in generated code
  • Tests wrapped with NET 11+ conditional compilation

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/Controls/src/Core/AppThemeBinding.cs Makes class and AppThemeResource constant public for NET11+, removes TODO comment
src/Controls/src/SourceGen/KnownMarkups.cs Wraps AppThemeBinding extension method with NET11+ directive, replaces helper method logic with object initializer approach
src/Controls/src/SourceGen/XamlGenerator.cs Removes AppThemeBindingHelpers source generation (170 lines deleted)
src/Controls/src/SourceGen/NodeSGExtensions.cs Conditionally includes AppThemeBindingExtension in late markup extensions dictionary for NET11+
src/Controls/tests/SourceGen.UnitTests/InitializeComponent/AppThemeBinding.cs Wraps entire test class with NET11+ directive, updates expected generated code to use object initializers

@PureWeen
Copy link
Member

  • failing tests are unrelated

@PureWeen PureWeen merged commit b763385 into main Dec 22, 2025
163 of 167 checks passed
@PureWeen PureWeen deleted the copilot/apply-pull-requests-33101-33107 branch December 22, 2025 18:13
StephaneDelcroix pushed a commit that referenced this pull request Jan 5, 2026
- [x] Apply changes from PR #33101 to AppThemeBinding.cs (make class
public for NET11+, make AppThemeResource public)
- [x] Apply changes from PR #33101 to KnownMarkups.cs (replace helper
methods with object initializers)
- [x] Apply changes from PR #33101 to XamlGenerator.cs (remove
AppThemeBindingHelpers generation)
- [x] Apply changes from PR #33101 to test file (wrap with
NET11_0_OR_GREATER)
- [x] Apply changes from PR #33107 to KnownMarkups.cs (wrap method with
NET11_0_OR_GREATER)
- [x] Apply changes from PR #33107 to NodeSGExtensions.cs (wrap
dictionary entry with NET11_0_OR_GREATER)
- [x] Verify changes compile successfully
- [x] Run relevant tests to ensure functionality (123 SourceGen tests
passed, 34 AppTheme XAML tests passed)
- [x] Code review completed (no issues found)
- [x] Security scan completed (no vulnerabilities found)
- [x] Remove unrelated HybridWebView.js.map file (per review feedback)

<!-- START COPILOT CODING AGENT SUFFIX -->



<!-- START COPILOT ORIGINAL PROMPT -->



<details>

<summary>Original prompt</summary>

> Please apply the changes from
#33101 and
#33107 to the main branch


</details>



<!-- START COPILOT CODING AGENT TIPS -->
---

✨ Let Copilot coding agent [set things up for
you](https://github.com/dotnet/maui/issues/new?title=✨+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot)
— coding agent works faster and does higher quality work when set up for
your repo.

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: PureWeen <5375137+PureWeen@users.noreply.github.com>
@github-actions github-actions bot locked and limited conversation to collaborators Jan 22, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants