Skip to content

fix(generator): Alias _View to UIElement on every target - #24457

Merged
MartinZikmund merged 4 commits into
masterfrom
dev/mazi/cs0407-template-builder
Sep 10, 2026
Merged

MartinZikmund merged 4 commits into
masterfrom
dev/mazi/cs0407-template-builder

Conversation

@MartinZikmund

@MartinZikmund MartinZikmund commented Sep 9, 2026 •

Copy link
Copy Markdown
Member

GitHub Issue: closes #24459

What

The XAML generator emits a platform-conditional alias for _View that predates the removal of native view rendering in 7.0:

#if HAS_UNO_SKIA
using _View = Microsoft.UI.Xaml.UIElement;
#elif __ANDROID__
using _View = Android.Views.View;
#elif __APPLE_UIKIT__ || __IOS__ || __TVOS__
using _View = UIKit.UIView;
#else
using _View = Microsoft.UI.Xaml.UIElement;
#endif

_View is the return type chosen at XamlFileGenerator.cs:6489 for every generated FrameworkTemplate builder (used at :6536 and :1037), and those builders are converted to Uno.UI.FrameworkTemplateBuilder at :6552 via MarkupHelper.CreateControlTemplate. That delegate returns UIElement (src/Uno.UI/Uno/FrameworkTemplateBuilder.cs:15). In 7.0 UIElement derives from DependencyObject and is unrelated to Android.Views.View / UIKit.UIView, so taking either native branch makes the method-group conversion illegal:

error CS0407: 'View GlobalStaticResources.ResourceDictionarySingleton__mergedpages_<hash>
    .Build_ResDicΞ204_StyΞ16_Set_ValΞ0_ConTem(object, TemplateMaterializationSettings)'
    has the wrong return type

Why it is never seen in CI, but breaks consumers

HAS_UNO_SKIA is defined by Uno.WinUI.Runtime.Skia.Android / .AppleUIKit, which ship it from build/ rather than buildTransitive/ — so it applies to a direct package reference only. The Uno SDK adds that reference itself with PrivateAssets="all". Every project in this repo, and every Uno.Sdk project anywhere, therefore lands in the first branch.

A plain <Project Sdk="Microsoft.NET.Sdk"> library that references Uno.WinUI does not get the constant, and Uno.WinUI's nuspec has no android/ios dependency group through which it could arrive. On iOS the fall-through is automatic — __IOS__ is defined by .NET for iOS itself. Such a library cannot compile any XAML template on a mobile target framework.

The snapshot tests compare generated text and embed the #if/#elif verbatim, so they pass regardless of platform — the defect is invisible to them.

Found while porting unoplatform/Uno.Themes#1722 to 7.0: Uno.Simple.WinUI is the one library there not on the Uno SDK, and it alone fails on net10.0-android and net10.0-ios.

The change

Collapse the block to the single alias that is correct on every target. Both native branches are dead code — Uno.WinUI 7.0 ships no android or ios assembly (lib/ holds only net10.0, net10.0-windows10.0.19041.0, net11.0, net11.0-windows10.0.19041.0), so they can only ever produce output that fails to compile. src/Uno.UI/UI/Xaml/Media/VisualTreeHelper.cs:26 already aliases unconditionally; only the generator was left behind.

The two branches actually taken today already emit exactly this line, so no configuration that builds today changes a single generated character. The 111 snapshot updates are that 9-line block collapsing to 1 line, and nothing else.

Verification

  • Isolation experiment proving causation: defining HAS_UNO_SKIA on the affected downstream library (Uno.Simple.WinUI, net10.0-android) takes it from 4 × CS0407 to 0 errors. That is the branch this PR makes unconditional.
  • Snapshot updates applied as an exact literal replacement of the full 9-line block, asserted to match exactly once per file across exactly 111 files, with zero residual HAS_UNO_SKIA / UIKit.UIView / Android.Views.View anywhere under XamlCodeGeneratorTests/Out.

Verified locally: the generator test suite now runs green on this branch — 493 tests, 0 failed, 479 passed, 14 skipped, using the CI-pinned .NET 11 preview SDK (11.0.100-preview.7.26381.103, per build/ci/net11/_global.json). Baseline check: the identical suite on master produces the same result, so this branch introduces no new failures.

Follow-up, out of scope

HasImplicitViewPinning (XamlFileGenerator.cs:7432-7433) is still true on every net*-ios/maccatalyst/macos compilation and emits now-pointless private Func<_View> _elementStubHolder_N; fields. Harmless after this fix — Func<UIElement> converts to the ctor's Func<object> — but the same stale native-view assumption.

🤖 Generated with Claude Code

https://claude.ai/code/session_01TgSByQzKDng9vt79kCkRTC

Copilot AI lite review requested due to automatic review settings September 9, 2026 11:11
@github-actions github-actions Bot added the area/code-generation Categorizes an issue or PR as relevant to code generation label Sep 9, 2026
@github-actions

github-actions Bot commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @MartinZikmund's task in 46s —— View job


Review complete ✅

Verdict: Approve — no blocking issues found.

This is a tightly-scoped, well-justified fix. Summary of what I checked:

  • Root cause is correctly identified and fixed at the source. XamlFileGenerator.cs (around line 342) previously emitted a platform-conditional using _View = ... alias that assumed native view rendering (Android.Views.View / UIKit.UIView), which predates the 7.0 removal of native rendering. Since _View is only ever consumed as the return type converted to Uno.UI.FrameworkTemplateBuilder (which returns UIElement), the native branches were dead code that could only ever produce a CS0407 return-type mismatch for any consumer not implicitly getting HAS_UNO_SKIA from the Uno SDK. Collapsing to the single correct alias is the right fix, not a guard/workaround.
  • No behavior change for anything that builds today. Verified this claim directly rather than just trusting the PR description: git diff origin/master...HEAD --numstat across all 112 changed snapshot files shows every single one is exactly 0 additions / 8 deletions — i.e., each is the identical mechanical collapse of the 9-line #if/#elif/#else block down to the one line already emitted on the HAS_UNO_SKIA and #else branches. No other snapshot content changed anywhere.
  • No other references to the old conditional or native-only assumption remain in XamlFileGenerator.cs — grepped for all _View usages (lines ~346, ~1143, ~6484) and they're all consistent with the new single alias.
  • Consistent with existing precedent: src/Uno.UI/UI/Xaml/Media/VisualTreeHelper.cs:26 already aliases _View/similar unconditionally, so this brings the generator in line with the rest of the codebase rather than introducing a new pattern.
  • Scope discipline: the PR correctly calls out HasImplicitViewPinning (still assuming native views, emitting harmless-but-stale Func<_View> fields) as an explicit, separate follow-up rather than scope-creeping it into this fix.
  • Commit message follows Conventional Commits (fix(generator): ...).

Not independently re-run: the generator test suite itself (author notes local SDK mismatch — master requires net11.0 SDK). The snapshot-diff analysis above is a reasonable substitute for confirming the change is mechanical, but CI's actual test run remains the gate for correctness, as the author states.

No inline comments posted — I found nothing to flag.

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.

🟡 Changes recommended

The code change looks correct, but the PR description needs a required linked GitHub issue (Fixes/Closes/Related) per repo policy before approval.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR fixes a generator/emitted-code mismatch by making the _View alias always resolve to Microsoft.UI.Xaml.UIElement, which matches the Uno.UI.FrameworkTemplateBuilder delegate return type and avoids invalid method-group conversions on mobile TFMs when HAS_UNO_SKIA is not defined.

Changes:

  • Simplify _View alias emission in XamlFileGenerator.cs to a single unconditional UIElement alias.
  • Update XAML generator snapshot baselines to reflect the collapsed alias block (removing the #if HAS_UNO_SKIA / native view branches).

Process note: The PR description currently doesn’t include a Fixes/Closes/Related to https://github.com/unoplatform/<REPO>/issues/#<ISSUE_NUMBER> footer; repo policy requires linking an issue (or explicitly noting “No related issue …”).

File summaries
File Description
src/SourceGenerators/Uno.UI.SourceGenerators/XamlGenerator/XamlFileGenerator.cs Emit _View alias as Microsoft.UI.Xaml.UIElement unconditionally.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_Xuid/WhXuBa/XamlCodeGenerator_ContentDialog1_7987c32aca55089a14f8c6c711f92359.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_TemplateSettings/WhTeHaNoDeObCo/XamlCodeGenerator_MainPage_0e3f323f9a22a3699cbcd4f0217eee4a.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_ResourceDictionary/WhTyXaCoReReDi/XamlCodeGenerator_MyResourceDictionary_147dbe765eba23608d8cd771f768c620.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_ResourceDictionary/WhTyReDiRoWiRe/XamlCodeGenerator_MyResourceDictionary_147dbe765eba23608d8cd771f768c620.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_ResourceDictionary/WhNeWiSiReAnEv/XamlCodeGenerator_RD_WNWSRAE_656341a3c9e6d4b4357d06ec15ae6fce.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_ResourceDictionary/TeTwLeNeMeDiWiTwReDi/XamlCodeGenerator_MyResourceDictionary_147dbe765eba23608d8cd771f768c620.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_ResourceDictionary/TeTwLeNeMeDiWiSiReDi/XamlCodeGenerator_MyResourceDictionary_147dbe765eba23608d8cd771f768c620.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_ResourceDictionary/TeThLeNeMeDi/XamlCodeGenerator_MyResourceDictionary_147dbe765eba23608d8cd771f768c620.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_ResourceDictionary/TeReDiAsAtPrShSeThPr/XamlCodeGenerator_MainPage_0e3f323f9a22a3699cbcd4f0217eee4a.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_RelativeUri/WhReUrIsRe/XamlCodeGenerator_MainPage_0e3f323f9a22a3699cbcd4f0217eee4a.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_RelativeUri/WhReUrInSe/XamlCodeGenerator_MainPage_0e3f323f9a22a3699cbcd4f0217eee4a.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_Parser/WhVePr/XamlCodeGenerator_MainPage_0e3f323f9a22a3699cbcd4f0217eee4a.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_Parser/WhSkXmNa/XamlCodeGenerator_MainPage_0e3f323f9a22a3699cbcd4f0217eee4a.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_Parser/WhNeSe/XamlCodeGenerator_MainPage_0e3f323f9a22a3699cbcd4f0217eee4a.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_Parser/WhNaIsOnNeEl/XamlCodeGenerator_MainPage_0e3f323f9a22a3699cbcd4f0217eee4a.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_Parser/WhMuWiIn/XamlCodeGenerator_ThirdPage_475d8edc4495de5bdb45b5c730a5c2f2.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_Parser/WhMuWiIn/XamlCodeGenerator_SecondPage_6b0363415e35aa5099bd5c22ab91d5f0.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_Parser/WhMuWiIn/XamlCodeGenerator_MainPage_0e3f323f9a22a3699cbcd4f0217eee4a.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_Parser/WhKeAcKePr/XamlCodeGenerator_MainPage_0e3f323f9a22a3699cbcd4f0217eee4a.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_Parser/WhInXm/XamlCodeGenerator_MainPage_0e3f323f9a22a3699cbcd4f0217eee4a.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_Parser/WhInRo/XamlCodeGenerator_MainPage_0e3f323f9a22a3699cbcd4f0217eee4a.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_Parser/WhInPoVa/XamlCodeGenerator_MainPage_0e3f323f9a22a3699cbcd4f0217eee4a.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_Parser/WhInObPr/XamlCodeGenerator_MainPage_0e3f323f9a22a3699cbcd4f0217eee4a.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_Parser/WhInObNo/XamlCodeGenerator_MainPage_0e3f323f9a22a3699cbcd4f0217eee4a.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_Parser/WhInMeNo/XamlCodeGenerator_MainPage_0e3f323f9a22a3699cbcd4f0217eee4a.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_Parser/WhInMaVa/XamlCodeGenerator_MainPage_0e3f323f9a22a3699cbcd4f0217eee4a.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_Parser/WhInGrLeVa/XamlCodeGenerator_MainPage_0e3f323f9a22a3699cbcd4f0217eee4a.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_Parser/WhInElPr/XamlCodeGenerator_MainPage_0e3f323f9a22a3699cbcd4f0217eee4a.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_Parser/WhInDoVa/XamlCodeGenerator_MainPage_0e3f323f9a22a3699cbcd4f0217eee4a.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_Parser/WhInCoRaVa/XamlCodeGenerator_MainPage_0e3f323f9a22a3699cbcd4f0217eee4a.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_Parser/WhIn/XamlCodeGenerator_MainPage_0e3f323f9a22a3699cbcd4f0217eee4a.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_Parser/WhEvOnToLeNoDeOb/XamlCodeGenerator_MainWindow_35b16a7cd4c5f6ba316b074a0da7f8d9.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_Parser/WhEvHa/XamlCodeGenerator_MainPage_0e3f323f9a22a3699cbcd4f0217eee4a.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_Parser/WhAtDP_InTy/XamlCodeGenerator_MainPage_0e3f323f9a22a3699cbcd4f0217eee4a.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_Parser.Errors/WhWMC0913_xLoRoEl/XamlCodeGenerator_MainPage_0e3f323f9a22a3699cbcd4f0217eee4a.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_Parser.Errors/WhWMC0913_xLoReDiNeMeOK/XamlCodeGenerator_MainPage_0e3f323f9a22a3699cbcd4f0217eee4a.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_Parser.Errors/WhWMC0913_xLoImReDiRo/XamlCodeGenerator_MainPage_0e3f323f9a22a3699cbcd4f0217eee4a.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_Parser.Errors/WhWMC0913_xLoExReDiRo/XamlCodeGenerator_MyRD_77da33433823c3123d21641a41765572.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_Parser.Errors/WhWMC0913_xLoDaTeRo/XamlCodeGenerator_MainPage_0e3f323f9a22a3699cbcd4f0217eee4a.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_Parser.Errors/WhWMC0913_xLoDaTeNeMeOK/XamlCodeGenerator_MainPage_0e3f323f9a22a3699cbcd4f0217eee4a.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_Parser.Errors/WhWMC0907_xNaLo/XamlCodeGenerator_MainPage_0e3f323f9a22a3699cbcd4f0217eee4a.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_Parser.Errors/WhInXaMuInEnVa/XamlCodeGenerator_MainPage_0e3f323f9a22a3699cbcd4f0217eee4a.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_Parser.Errors/WhInXaInEnVa/XamlCodeGenerator_MainPage_0e3f323f9a22a3699cbcd4f0217eee4a.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_Parser.Errors/WhInXaCa003/XamlCodeGenerator_MainPage_0e3f323f9a22a3699cbcd4f0217eee4a.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_Parser.Errors/WhInXaCa002/XamlCodeGenerator_MainPage_0e3f323f9a22a3699cbcd4f0217eee4a.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_Parser.Errors/WhInXaCa001/XamlCodeGenerator_MainPage_0e3f323f9a22a3699cbcd4f0217eee4a.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_Parser.Errors/WhInXaCa001_InReSoPr/XamlCodeGenerator_MainPage_0e3f323f9a22a3699cbcd4f0217eee4a.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_Parser.Errors/WhInXaCa001_InReSoMo/XamlCodeGenerator_MainPage_0e3f323f9a22a3699cbcd4f0217eee4a.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_Parser.Errors/WhInXaCa001_BiEr/XamlCodeGenerator_MainPage_0e3f323f9a22a3699cbcd4f0217eee4a.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_Parser.ClrNamespace/WhClNaXmUs/XamlCodeGenerator_MainPage_0e3f323f9a22a3699cbcd4f0217eee4a.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_Parser.ClrNamespace/WhClNaXmUn/XamlCodeGenerator_MainPage_0e3f323f9a22a3699cbcd4f0217eee4a.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_Parser.ClrNamespace/WhClNaXmInSc/XamlCodeGenerator_MainPage_0e3f323f9a22a3699cbcd4f0217eee4a.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_Parser.ClrNamespace/WhClNaXmIg/XamlCodeGenerator_MainPage_0e3f323f9a22a3699cbcd4f0217eee4a.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_NoFuzzyMatching/TeViBoPa/XamlCodeGenerator_MainPage_0e3f323f9a22a3699cbcd4f0217eee4a.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_NoFuzzyMatching/TeTyPrWiXSt/XamlCodeGenerator_MainPage_0e3f323f9a22a3699cbcd4f0217eee4a.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_MvvmGeneratedMembers/WOPAE_name/XamlCodeGenerator_MainPage_0e3f323f9a22a3699cbcd4f0217eee4a.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_MvvmGeneratedMembers/WOPAE_m_name/XamlCodeGenerator_MainPage_0e3f323f9a22a3699cbcd4f0217eee4a.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_MvvmGeneratedMembers/WOPAE__name/XamlCodeGenerator_MainPage_0e3f323f9a22a3699cbcd4f0217eee4a.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_MvvmGeneratedMembers/WOPADNE/XamlCodeGenerator_MainPage_0e3f323f9a22a3699cbcd4f0217eee4a.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_MvvmGeneratedMembers/WNBOP/XamlCodeGenerator_MainPage_0e3f323f9a22a3699cbcd4f0217eee4a.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_MvvmGeneratedMembers/WBOP/XamlCodeGenerator_MainPage_0e3f323f9a22a3699cbcd4f0217eee4a.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_MarkupExtensionNameProperty/WhMaExNaOnLaEl/XamlCodeGenerator_MainPage_0e3f323f9a22a3699cbcd4f0217eee4a.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_MarkupExtensionNameProperty/WhMaExNaMaViStSeTa/XamlCodeGenerator_MainPage_0e3f323f9a22a3699cbcd4f0217eee4a.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_MarkupExtensionNameProperty/WhElTyHaCoExCl/XamlCodeGenerator_MainPage_0e3f323f9a22a3699cbcd4f0217eee4a.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_MarkupExtension/TeNuMaExInRePr/XamlCodeGenerator_MainPage_0e3f323f9a22a3699cbcd4f0217eee4a.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_MarkupExtension/TeNuMaExInAtPr/XamlCodeGenerator_MainPage_0e3f323f9a22a3699cbcd4f0217eee4a.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_MarkupExtension/TeMaExWiShWiAc/XamlCodeGenerator_MainWindow_35b16a7cd4c5f6ba316b074a0da7f8d9.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_MarkupExtension/TeMaExWiShFrElLo/XamlCodeGenerator_MainPage_0e3f323f9a22a3699cbcd4f0217eee4a.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_MarkupExtension/TeCoAnCoExInSaNa/XamlCodeGenerator_MainPage_0e3f323f9a22a3699cbcd4f0217eee4a.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_LazyLoading/WhLoChHaBi/XamlCodeGenerator_MainPage_0e3f323f9a22a3699cbcd4f0217eee4a.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_LazyLoading/WhDeLoStNoViSe/XamlCodeGenerator_MainPage_0e3f323f9a22a3699cbcd4f0217eee4a.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_ImplicitXamlNamespaces/WhAmTyInGlNa/XamlCodeGenerator_MainPage_0e3f323f9a22a3699cbcd4f0217eee4a.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_HotReloadEnabledInBuild/SeOrSoLoNoSeFoReFrSo/XamlCodeGenerator_MainPage_0e3f323f9a22a3699cbcd4f0217eee4a.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_HotReloadEnabledInBuild/SeOrSoLoKeThPaVeInThEmLi/XamlCodeGenerator_Ma_in_Pägé_c557fd15e80a75bdd79cae415a71aa3d.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_HotReloadEnabledInBuild/SeOrSoLoInOuFoTyReDi/XamlCodeGenerator_MainPage_0e3f323f9a22a3699cbcd4f0217eee4a.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_HotReloadEnabledInBuild/SeOrSoLoInOuFoReTy/XamlCodeGenerator_MainPage_0e3f323f9a22a3699cbcd4f0217eee4a.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_HotReloadEnabledInBuild/SeOrSoLoInOuFoReDiFi/XamlCodeGenerator_OtherDictionary_218afd2e503a1577f4ce46cd7f3fc921.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_HotReloadEnabledInBuild/SeOrSoLoInOuFoReDiFi/XamlCodeGenerator_MyDictionary_b31577bd88a443cc7e422162f7097e83.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_HotReloadEnabledInBuild/SeOrSoLoInOuFoPaLeSt/XamlCodeGenerator_MainPage_0e3f323f9a22a3699cbcd4f0217eee4a.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_HotReloadEnabledInBuild/SeOrSoLoInOuFoPaLeRe/XamlCodeGenerator_MainPage_0e3f323f9a22a3699cbcd4f0217eee4a.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_HotReloadEnabledInBuild/SeOrSoLoInOuFoExReDi/XamlCodeGenerator_MainPage_0e3f323f9a22a3699cbcd4f0217eee4a.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_HotReloadEnabledInBuild/SeOrSoLoInInOuFoEmDaTe/XamlCodeGenerator_EmptyDataTemplatePage_14a64d66c7071a2b54a8c9a36712e00c.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_HotReloadEnabledInBuild/SeOrSoLoInInOuFoDeObThArFrEl/XamlCodeGenerator_MainPage_0e3f323f9a22a3699cbcd4f0217eee4a.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_HotReloadEnabledInBuild/SeBaUrInInOuFoFrEl/XamlCodeGenerator_MainPage_0e3f323f9a22a3699cbcd4f0217eee4a.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_HotReloadEnabledInBuild/ReDiCoBe/XamlCodeGenerator_MyDictionary_b31577bd88a443cc7e422162f7097e83.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_HoistedResourceOwner/WhCuMaExInLaReInTe/XamlCodeGenerator_MainPage_0e3f323f9a22a3699cbcd4f0217eee4a.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_HoistedResourceOwner/WhCuMaExInLaRe/XamlCodeGenerator_MainPage_0e3f323f9a22a3699cbcd4f0217eee4a.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_Grid/WhGrUsNeSuSy/XamlCodeGenerator_Grid_Uses_New_Succinct_Syntax_0b49a2c98bcf0a7403d6de3124559ba4.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_Grid/WhGrUsNeAsCoPrSy/XamlCodeGenerator_Grid_Uses_New_Assigned_ContentProperty_Syntax_b80fca056e1bf6bae00bca0b4dfe18d7.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_Grid/WhGrUsCoSy/XamlCodeGenerator_Grid_Uses_Common_Syntax_c1be4430470ec234df472eb5ce9cbaaf.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_Grid/WhGrUsBoSy/XamlCodeGenerator_Grid_Uses_Both_Syntaxes_5d0366ecb133af4c31f7d61373b58fb4.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_GenerateEmbeddedXamlSources/EsTrQu/XamlCodeGenerator_MainPage_0e3f323f9a22a3699cbcd4f0217eee4a.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_GenerateEmbeddedXamlSources/EsNQu/XamlCodeGenerator_MainPage_0e3f323f9a22a3699cbcd4f0217eee4a.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_Binding/WhXaObWiXaObPr/XamlCodeGenerator_Binding_Xaml_Object_With_Xaml_Object_Properties_13ccd64bb03497e9fbd3d015c5d7874a.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_Binding/WhXaObWiCoPr/XamlCodeGenerator_Binding_Xaml_Object_With_Common_Properties_32c9951cc1e205007e0c313480b9e8bf.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_Binding/WhStXBiPrInDaTeWiDaTy/XamlCodeGenerator_MainPage_0e3f323f9a22a3699cbcd4f0217eee4a.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_Binding/WhStXBiEvInDaTeWiDaTy/XamlCodeGenerator_MainPage_0e3f323f9a22a3699cbcd4f0217eee4a.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_Binding/WhBiElNaInTe/XamlCodeGenerator_Binding_ElementName_In_Template_d9353a41d6883de0ddf51bf7c4e43f1e.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_Binding/TeXBiReXLoEl/XamlCodeGenerator_MainPage_0e3f323f9a22a3699cbcd4f0217eee4a.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_Binding/TeTwWa/XamlCodeGenerator_MainPage_0e3f323f9a22a3699cbcd4f0217eee4a.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_Binding/TeTeInXLoEl/XamlCodeGenerator_MainPage_0e3f323f9a22a3699cbcd4f0217eee4a.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_Binding/TeReSoShSy/XamlCodeGenerator_MainPage_0e3f323f9a22a3699cbcd4f0217eee4a.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_Binding/TeReSoFuXmSy/XamlCodeGenerator_MainPage_0e3f323f9a22a3699cbcd4f0217eee4a.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_Binding/TeReSoExSy/XamlCodeGenerator_MainPage_0e3f323f9a22a3699cbcd4f0217eee4a.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_Binding/TePaXBiReXLoEl/XamlCodeGenerator_MainPage_0e3f323f9a22a3699cbcd4f0217eee4a.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_Binding/TeInMe/XamlCodeGenerator_MainPage_0e3f323f9a22a3699cbcd4f0217eee4a.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_Binding/TeInDeFrAn/XamlCodeGenerator_MainPage_0e3f323f9a22a3699cbcd4f0217eee4a.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_Binding/TeDeBiMoInDaTeInReDi/XamlCodeGenerator_MyResourceDictionary_147dbe765eba23608d8cd771f768c620.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_Binding/TeBaTyNoSpInCoBe/XamlCodeGenerator_UserControl1_32e87d7058152b347bbc5c24e16f8b3c.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_Binding/TeBaTyNoSpInCoBe/XamlCodeGenerator_MainPage_0e3f323f9a22a3699cbcd4f0217eee4a.cs Snapshot update: remove conditional/native _View alias block.
src/SourceGenerators/Uno.UI.SourceGenerators.Tests/XamlCodeGeneratorTests/Out/Given_Binding/TeAcAr/XamlCodeGenerator_MainPage_0e3f323f9a22a3699cbcd4f0217eee4a.cs Snapshot update: remove conditional/native _View alias block.
Review details
  • Files reviewed: 1/112 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

@unodevops

Copy link
Copy Markdown
Contributor

@unodevops

Copy link
Copy Markdown
Contributor

⚠️⚠️ The build 232744 has failed on Uno.UI - CI.

Copilot AI review requested due to automatic review settings September 9, 2026 14:40
@github-actions

github-actions Bot commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @MartinZikmund's task in 55s —— View job


Review complete

Verdict: Approve — no blocking issues found. No inline comments posted.

  • Gather context
  • Inspect diff (git diff origin/master...HEAD)
  • Review core generator change (XamlFileGenerator.cs)
  • Spot-check snapshot updates for consistency
  • Post inline findings (none needed)
  • Post summary

What I checked:

  • XamlFileGenerator.cs:342-351 — the 9-line platform-conditional #if HAS_UNO_SKIA / #elif __ANDROID__ / #elif __APPLE_UIKIT__.../ #else block collapses to a single unconditional using _View = Microsoft.UI.Xaml.UIElement;. This lines up with Uno.UI.FrameworkTemplateBuilder (src/Uno.UI/Uno/FrameworkTemplateBuilder.cs:15), which returns UIElement unconditionally — so the native branches (Android.Views.View, UIKit.UIView) could never legally satisfy the method-group conversion at XamlFileGenerator.cs:6552 on any target that actually took them. Root-cause fix, not a guard.
  • Verified grep across XamlCodeGeneratorTests/Out/ for HAS_UNO_SKIA, Android.Views.View, UIKit.UIView returns zero matches — the snapshot regen is complete and consistent.
  • Diffed several snapshot files directly (not just trusting the stat summary): each is exactly the 9-line conditional block replaced by the 1 line already emitted on the HAS_UNO_SKIA/#else branches, byte-for-byte — confirms no generated output changes for anything that compiles today.
  • Second commit (test(generator): Realign diagnostic spans...) shifts expected diagnostic line/column spans in Given_Grid.cs, Given_ImplicitXamlNamespaces.cs, Given_MvvmGeneratedMembers.cs, and Given_Parser.cs — every shifted span moves by exactly -8 lines, matching the 9→1 line collapse. No unrelated span drift.
  • Both commits (fix(generator): ..., test(generator): ...) follow Conventional Commits.
  • No new public API surface, no DependencyProperty, no events, no async code touched — none of those checklist items apply here.
  • The added comment at XamlFileGenerator.cs:344-347 explains a genuinely non-obvious cross-file invariant (the _View→FrameworkTemplateBuilder→UIElement chain), consistent with the repo's "comment only the non-obvious why" guidance.
  • Scope discipline: HasImplicitViewPinning's stale Func<_View> emission is correctly called out as an explicit, harmless follow-up rather than folded into this fix.

Cross-cutting notes:

  • The one open process item is the Copilot reviewer's note that the PR description lacks a linked GitHub issue per repo policy — worth adding a Fixes #... (or explicit "no related issue") line before merge, though it doesn't affect code correctness.
  • CI previously failed (build 232744) prior to the second commit; the realigned spans in the latest commit appear to address exactly that class of failure (stale line numbers in ExpectedDiagnostics). Worth confirming the latest CI run is green before merging.

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.

🟢 Approval recommended

The change is narrowly scoped, aligns generator output with the actual FrameworkTemplateBuilder contract, and the necessary snapshot/span updates are included.

Review details
  • Files reviewed: 5/116 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

@unodevops

Copy link
Copy Markdown
Contributor

⚠️⚠️ The build 232776 has failed on Uno.UI - CI.

@MartinZikmund

Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines

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

@unodevops

Copy link
Copy Markdown
Contributor

⚠️⚠️ The build 232825 has failed on Uno.UI - CI.

@MartinZikmund

Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines

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

@unodevops

Copy link
Copy Markdown
Contributor

⚠️⚠️ The build 232862 has failed on Uno.UI - CI.

Copilot AI review requested due to automatic review settings September 10, 2026 05:32
@MartinZikmund
MartinZikmund force-pushed the dev/mazi/cs0407-template-builder branch from e6fa36b to 792a462 Compare September 10, 2026 05:32
@github-actions

github-actions Bot commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @MartinZikmund's task in 1m 18s —— View job


Review complete

Verdict: Approve — no blocking issues found. No inline comments posted.

  • Gather context (PR description, comments, diff)
  • Review core generator change (XamlFileGenerator.cs)
  • Review test span-realignment changes (Given_Grid.cs, Given_ImplicitXamlNamespaces.cs, Given_MvvmGeneratedMembers.cs, Given_Parser.cs)
  • Spot-check snapshot updates for consistency
  • Check CI status
  • Post inline findings (none needed)
  • Post summary

Independently verified:

  • XamlFileGenerator.cs:342-351 collapses the 9-line #if HAS_UNO_SKIA / #elif __ANDROID__ / #elif __APPLE_UIKIT__.../ #else block to one unconditional using _View = Microsoft.UI.Xaml.UIElement;. Confirmed Uno.UI.FrameworkTemplateBuilder (src/Uno.UI/Uno/FrameworkTemplateBuilder.cs:15) returns UIElement? unconditionally, so the native branches could never legally satisfy the method-group conversion on any target that actually took them — this is a root-cause fix of dead/incorrect code, not a guard.
  • git diff HEAD~2..HEAD --numstat on all 111 changed snapshot files under XamlCodeGeneratorTests/Out/ shows every single one is exactly 0 additions / 8 deletions — the identical mechanical collapse, byte-for-byte, confirming no generated output changes for anything that compiles today.
  • grep -r "HAS_UNO_SKIA\|UIKit.UIView\|Android.Views.View" across XamlCodeGeneratorTests/Out/ returns zero matches — regeneration is complete.
  • The span-realignment commit shifts every WithSpan(...) line number by exactly -8 in Given_Grid.cs, Given_ImplicitXamlNamespaces.cs, Given_MvvmGeneratedMembers.cs, and Given_Parser.cs, matching the 9→1 line collapse precisely — no unrelated drift.
  • Both commits follow Conventional Commits.
  • Scope discipline: the PR correctly defers HasImplicitViewPinning's stale Func<_View> emission as an explicit, harmless follow-up rather than folding it in.

Cross-cutting notes (not blocking, but worth eyes before merge):

  • Azure Pipelines "Uno.UI - CI" failed four times on this PR (builds 232744, 232776, 232825, 232862), including twice after the diagnostic-span-realignment commit that was meant to fix the first failure. I don't have access to Azure Pipelines logs to determine whether the repeated post-fix failures are a genuine remaining issue or CI flakiness/infra — worth confirming the latest run is green (or understanding why it isn't) before merging.
  • The static-analysis bot's Path.Combine "may silently drop arguments" comments on the diagnostic-span test files are a pre-existing pattern already used throughout this file for constant, non-rooted relative-path segments (not introduced by this PR, and not exploitable here) — not a real finding.

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.

🟢 Approval recommended

The functional change is narrow and well-justified (fixes a real downstream compile failure), with only a minor test-comment coordinate mismatch to optionally clean up.

Review details
  • Files reviewed: 5/116 changed files
  • Comments generated: 1
  • Review effort level: Lite

@github-actions

github-actions Bot commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @MartinZikmund's task in 1m 29s —— View job


Reviewing PR #24457

  • Gather context (PR description, comments, diff, review comments)
  • Review core generator change (XamlFileGenerator.cs)
  • Review snapshot updates for consistency
  • Review test span-realignment changes
  • Check for SOLID/AGENTS.md rule violations, root-cause vs guard, cross-platform correctness
  • Post inline findings (none needed)
  • Post summary

Verdict: Approve — no blocking issues found. No inline comments posted.

Independently verified (not just re-reading prior review comments):

  • XamlFileGenerator.cs:342-351 collapses the 9-line #if HAS_UNO_SKIA / #elif __ANDROID__ / #elif __APPLE_UIKIT__... / #else block into one unconditional using _View = Microsoft.UI.Xaml.UIElement;. Confirmed Uno.UI.FrameworkTemplateBuilder (src/Uno.UI/Uno/FrameworkTemplateBuilder.cs:15) is public delegate UIElement? FrameworkTemplateBuilder(...) — unconditional across all targets — so the native branches could never legally satisfy the method-group conversion. This is a root-cause fix removing dead/incorrect code, not a guard.
  • grep -n "_View\b" across XamlFileGenerator.cs shows only 3 remaining usages (comment, the deferred Func<_View> field emission at line 1143, and the return-type site at line 6484) — all consistent with the new single alias and the explicitly-deferred HasImplicitViewPinning follow-up.
  • grep -rn "HAS_UNO_SKIA" under src/SourceGenerators/Uno.UI.SourceGenerators/ returns nothing else — confirms this was the only place the stale conditional lived in the generator.
  • git diff origin/master HEAD --numstat on all 100 changed snapshot files under XamlCodeGeneratorTests/Out/ shows every one is exactly 0 additions / 8 deletions — spot-checked one full diff (Given_Grid/WhGrUsBoSy/...) byte-for-byte and it's precisely the 9→1 line collapse, nothing else changed.
  • grep for HAS_UNO_SKIA/Android.Views.View/UIKit.UIView under Out/ returns zero matches — regeneration is complete, no residue.
  • The 4 test files with span realignments (Given_Grid.cs, Given_ImplicitXamlNamespaces.cs, Given_MvvmGeneratedMembers.cs, Given_Parser.cs) each shift every WithSpan(...) line number by exactly -8, matching the 9→1 collapse precisely — verified each diff directly.
  • The stale reference-comment mismatch flagged by an earlier Copilot review pass (Given_MvvmGeneratedMembers.cs, comment said (124,252) vs. assertion 116,254) is now fixed in the latest commit (26410285) — comment and span agree.
  • All Path.Combine → Path.Join changes in the four test files are consistent; the one Path.Combine call intentionally left in Given_ImplicitXamlNamespaces.cs's comment/rationale about host path separators is unaffected and still accurate.
  • All 4 commits follow Conventional Commits (fix(generator): ..., test(generator): ... × 3).

Cross-cutting note (not blocking): the linked-GitHub-issue policy note from the automated Copilot review (PR description has no Fixes #... line) is a process/documentation item, not a code defect — worth adding before merge per repo convention, but doesn't affect correctness.

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.

🟢 Approval recommended

The change is narrowly scoped to generator output correctness and corresponding snapshot/test expectation updates, with no functional regressions identified in the reviewed diffs.

Review details

Suppressed comments (1)

Previously missed (1) — in code that hasn't changed since the last review.

src/SourceGenerators/Uno.UI.SourceGenerators/XamlGenerator/XamlFileGenerator.cs:350

  • Regression coverage: the generator previously emitted different _View aliases based on preprocessor symbols, and the failure only reproduces when HAS_UNO_SKIA is not defined but __ANDROID__/__IOS__ is. The current snapshot tests update the text but still don’t exercise compilation under those symbol sets, so a future regression could slip through again. Consider adding a unit test that runs the generator with PreprocessorSymbols including __ANDROID__ and separately __IOS__ (and without HAS_UNO_SKIA) and asserts the generated sources compile.
  • Files reviewed: 5/116 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

Copilot AI review requested due to automatic review settings September 10, 2026 05:45

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.

🟢 Approval recommended

The generator change is narrowly scoped, aligns _View with the actual FrameworkTemplateBuilder return type, and the accompanying snapshot/test expectation updates reflect the resulting deterministic output.

Review details
  • Files reviewed: 5/116 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

@unodevops

Copy link
Copy Markdown
Contributor

MartinZikmund and others added 4 commits September 10, 2026 08:34
Uno 7.0 removed native view rendering, but the XAML generator still emitted a
platform-conditional alias for `_View`:

    #if HAS_UNO_SKIA
    using _View = Microsoft.UI.Xaml.UIElement;
    #elif __ANDROID__
    using _View = Android.Views.View;
    #elif __APPLE_UIKIT__ || __IOS__ || __TVOS__
    using _View = UIKit.UIView;
    #else
    using _View = Microsoft.UI.Xaml.UIElement;
    #endif

`_View` is the return type of every generated FrameworkTemplate builder, and
those builders are converted to `Uno.UI.FrameworkTemplateBuilder`, which
returns `UIElement`. In 7.0 `UIElement` derives from `DependencyObject` and
has no relationship to `Android.Views.View` or `UIKit.UIView`, so whenever one
of the two native branches is taken the method-group conversion fails:

    error CS0407: 'View GlobalStaticResources...Build_..._ConTem(
        object, TemplateMaterializationSettings)' has the wrong return type

Both native branches are dead: Uno.WinUI 7.0 ships no android or ios assembly,
so they can only ever produce output that does not compile.

They are still reachable downstream. `HAS_UNO_SKIA` comes from
Uno.WinUI.Runtime.Skia.Android/.AppleUIKit, which ship it from `build/` rather
than `buildTransitive/`, so it applies to a direct reference only — and the
Uno SDK adds that reference with `PrivateAssets="all"`. Every Uno.Sdk project
therefore takes the first branch, which is why CI never sees this, while a
plain `Microsoft.NET.Sdk` library referencing Uno.WinUI on a mobile target
framework cannot compile any XAML template at all.

Collapse the block to the single alias that is correct everywhere. The two
branches that are actually taken today already emit exactly this line, so no
configuration that builds today changes a single generated character.

Verified: forcing `HAS_UNO_SKIA` on the affected library downstream
(Uno.Simple.WinUI in uno.themes, net10.0-android) takes the error count from
4 CS0407 to 0, which isolates the alias as the cause.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01TgSByQzKDng9vt79kCkRTC
Collapsing the `_View` alias block from 9 lines to 1 shifted every line of
generated XAML output up by 8. The 111 expected-output files were regenerated,
but eight `WithSpan(...)` assertions hard-code line numbers *into* that
generated file from test source, and those were missed:

    Expected diagnostic to start on line "76" was actually on line "68"

Five tests fail as a result — When_ObservableProperty_AttributeDoesNotExists,
When_Ambiguous_Type_In_Global_Namespaces, When_Invalid_Member_Node,
When_Invalid_Object_Node and When_Grid_Uses_Both_Syntaxes.

Shift the eight generated-file spans by 8. Spans pointing at the XAML input or
at the user's own C# are unaffected and left alone.

Verified locally on the net11 preview SDK: 493 tests, 5 failed before, 0 after.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01GSKHVLNtHS6yTB5V3ww3d7
The github-code-quality analyzer flags every multi-argument Path.Combine
on the WithSpan expected-diagnostic paths ("may silently drop its earlier
arguments"). The arguments here are constant relative literals, so none
can be rooted, but Path.Join carries no rooted-reset semantics at all and
emits the same string.

Not a hardcoded '/' literal, as one of the analyzer suggestions proposed:
the generated document path uses the host separator, so a literal would
break these assertions on Windows.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01MmoGiAqxB74J2xwvHz2qqu
The span realignment updated two of the three CS1061 reference comments in
this block; the third still named (124,252) while its assertion targets
116,254. The column was already off by two before the realignment.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01MmoGiAqxB74J2xwvHz2qqu
Copilot AI review requested due to automatic review settings September 10, 2026 06:34
@MartinZikmund
MartinZikmund force-pushed the dev/mazi/cs0407-template-builder branch from 2641028 to e087ab2 Compare September 10, 2026 06:34
@github-actions

github-actions Bot commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @MartinZikmund's task in 35s —— View job


Review complete

Verdict: Approve — no blocking issues found. No inline comments posted.

  • Gather context (PR description, prior reviews, diff)
  • Check what changed since the last review round
  • Re-verify core generator change and snapshot consistency
  • Verify the stale-comment fix (Given_MvvmGeneratedMembers.cs) landed correctly
  • Post summary

What changed since the last review round: exactly one new commit, e087ab20 (test(generator): Sync stale diagnostic reference comment), a single-line change to Given_MvvmGeneratedMembers.cs:273. Verified via git show e087ab20: it updates only the comment text from (124,252) to (116,254) — no assertion logic touched. This is precisely the fix for the stale-comment finding raised by the earlier automated review pass (and already independently confirmed fixed by @MartinZikmund's own inline replies). Re-read the surrounding block (lines 269–274): all three // ...cs(N,254): error CS1061... comments now agree with their respective WithSpan(...) assertions (68,254 / 92,254 / 116,254).

No other files changed in this push. Everything from the prior review rounds still holds:

  • XamlFileGenerator.cs collapses the 9-line platform-conditional _View alias to one unconditional using _View = Microsoft.UI.Xaml.UIElement;, matching FrameworkTemplateBuilder's unconditional UIElement? return type — a root-cause fix, not a guard.
  • All 111 snapshot updates are the identical mechanical 9→1 line collapse.
  • The Path.Join follow-up in the test files addresses the CodeQL Path.Combine findings without changing any asserted values.
  • Scope discipline: HasImplicitViewPinning's stale Func<_View> emission is correctly deferred as a separate, harmless follow-up.

Cross-cutting note (unchanged from prior rounds): I can't execute the generator test suite in this environment; the author has reported it green locally (493 tests / 0 failed) on the CI-pinned .NET 11 preview SDK. Worth confirming the latest CI run is green before merging.

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.

🟢 Approval recommended

The change is a targeted generator correctness fix with consistent snapshot/test updates and no remaining stale _View conditional aliases in the checked-in expected outputs.

Review details
  • Files reviewed: 5/116 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

@unodevops

Copy link
Copy Markdown
Contributor

@unodevops

Copy link
Copy Markdown
Contributor

⚠️⚠️ The build 232883 has failed on Uno.UI - CI.

@mergify

mergify Bot commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@MartinZikmund
MartinZikmund merged commit d5b9af4 into master Sep 10, 2026
57 checks passed
@MartinZikmund
MartinZikmund deleted the dev/mazi/cs0407-template-builder branch September 10, 2026 10:16
MartinZikmund added a commit to unoplatform/Uno.Themes that referenced this pull request Sep 10, 2026
`Uno.ShowMeTheXAML` 3.0.0-dev0001 depends on `Uno.WinUI` >= 7.0.0-dev.684,
so pinning the SDK at 7.0.0-dev.679 fails every head at restore:

    error NU1605: Detected package downgrade: Uno.WinUI from 7.0.0-dev.684
    to 7.0.0-dev.679

7.0.0-dev.697 also carries the XAML generator fix from unoplatform/uno#24457,
which clears the CS0407 `_View` return-type errors that blocked
`Uno.Simple.WinUI` on net10.0-android and net10.0-ios. Verified the fix is in
this package: its nuspec pins commit ee8ffda8, and the PR's merge commit
d5b9af48 is an ancestor of it.

Both `global.json` files move together, since the nested one governs a sample
head built directly, which is what CI does.

Verified by publishing the Material desktop head with the CI command: 0 errors.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01TgSByQzKDng9vt79kCkRTC
MartinZikmund added a commit to unoplatform/Uno.Themes that referenced this pull request Sep 10, 2026
`Uno.ShowMeTheXAML` 3.0.0-dev0001 depends on `Uno.WinUI` >= 7.0.0-dev.684,
so pinning the SDK at 7.0.0-dev.679 fails every head at restore:

    error NU1605: Detected package downgrade: Uno.WinUI from 7.0.0-dev.684
    to 7.0.0-dev.679

7.0.0-dev.697 also carries the XAML generator fix from unoplatform/uno#24457,
which clears the CS0407 `_View` return-type errors that blocked
`Uno.Simple.WinUI` on net10.0-android and net10.0-ios. Verified the fix is in
this package: its nuspec pins commit ee8ffda8, and the PR's merge commit
d5b9af48 is an ancestor of it.

Both `global.json` files move together, since the nested one governs a sample
head built directly, which is what CI does.

Verified by publishing the Material desktop head with the CI command: 0 errors.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01TgSByQzKDng9vt79kCkRTC
rajamatt added a commit to unoplatform/Uno.Themes that referenced this pull request Sep 23, 2026
* Version bump after 7.0 release branch (#1686)

* docs: add v7 migration section to upgrading guide (#1690)

* docs: add v7 migration section to upgrading guide

* docs: simplify sections

* docs: remove unecessary mentions

* docs: fix for linter

* Version bump after 7.1 release branch (#1691)

* feat(samples): host all theme sample apps in one ThemesSampleApp wrapper head (#1693)

Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
Co-authored-by: Claude Fable 5 <[email protected]>

* docs(samples): link filed upstream issues from ALC teardown sweeps (#1696)

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>

* feat: Color Fidelity (#1697)

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
Co-authored-by: Claude Fable 5 <[email protected]>

* feat!: add DefaultSpacing base unit and make Density a pure mode (#1701)

Co-authored-by: Claude Fable 5 <[email protected]>

* feat: add instance-based Application.GetTheme() extension (#1699)

Co-authored-by: Claude Fable 5 <[email protected]>

* ci: Build and publish from servicing/* branches

A servicing/* branch continues a previous version line after master has moved
on to a newer one, so it needs to build and publish dev packages the same way
master does.

Adds servicing/* to the build and PR triggers, the Publish_Dev stage condition,
the dev-feed push step and the NBGV publicReleaseRefSpec. Every change is an
additional branch pattern inside an existing or(), so master's own behaviour is
unchanged.

This already exists on servicing/7.2, which is how it publishes today. Bringing
it to master makes the pattern canonical, so the next servicing branch inherits
it instead of having to rediscover the edits.

* ci: Validate conventional commits on servicing/* branches

'Validate Conventional Commits' is a required status check on master. Adding
servicing/* here is a prerequisite for giving servicing branches the same
branch protection as master -- without it the check never reports and a PR
into a servicing branch could never be merged.

* feat!: collapse the root typeface tokens into a single DefaultFontFamily (#1710)

Co-authored-by: Claude Fable 5 <[email protected]>
Co-authored-by: Claude Fable 5.1 <[email protected]>
Co-authored-by: Derek Raven <[email protected]>

* feat(themes): add DefaultFontFamily to BaseTheme and re-resolve the font override

Stack 2/2 — sits on the single-typeface token collapse (feat!: collapse
the root typeface tokens into a single DefaultFontFamily). Closes #1705.

- DefaultFontFamily DP on BaseTheme: one FontFamily generates the
  DefaultFontFamily root token and all 19 type-scale *FontFamily keys
  (GenerateFontFamilyScale + ThemesConstants.TypefaceScaleKeys), plus each
  design system's own per-control *FontFamily aliases (FontFamilyAliasKeys
  on MaterialTheme/SimpleTheme), under Default/Light/HighContrast
- the font override is resolved in UpdateSource() and merged last; a
  URI-backed override is re-read from its Source when a hot reload
  invalidates it, so edits reach the theme (fixes #1705) while unrelated
  rebuilds reuse the resolved copy; duplicated merge removed from
  MaterialTheme/SimpleTheme
- override load/re-read fallbacks emit a guarded LogWarning with the URI
- SemanticThemeHelper.DefaultFontFamily accessor
- FontFamilyTunerControl on the Design Tokens page sets the family on the
  running theme and restyles already-rendered text via a RequestedTheme flip
- runtime tests: Given_DefaultFontFamily (generation, alias keys, every
  SharedTypography slot, appearance coverage, unset/clear/replace, override
  precedence, #1705 re-resolution through the hot-reload entry point),
  Given_FontFamilyTuner
- design-tokens doc: property row + property-based Typography Font Swap

Adapted to the single-token base: the generator emits DefaultFontFamily
instead of the removed TypefacePlain/TypefaceBrand pair, and the tuner
offers variable-font entry points so *FontWeight tokens keep resolving.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01BJokqo5p49ysm5TtcanEWt
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01ER3xjPyWwDRhiBmYgPojMu

* fix(simple): resolve button typeface aliases through ThemeResource

- `SimpleButtonFontFamily` / `SimpleToggleButtonFontFamily` are regenerated by the
  `DefaultFontFamily` layer, but the Button and ToggleButton setters read them with
  `{StaticResource}`, which resolves once at parse time: the keys followed the property
  while the rendered controls stayed on Inter.
- Switch the four setters to `{ThemeResource}`, matching every other `*FontFamily` setter
  in Material v2 and Simple (`DatePickerFlyoutPresenterFontFamily` was already correct).
- Add `Given_DefaultFontFamily.When_DefaultFontFamilyChanges_Then_StyledButtonFollows`,
  asserting the rendered `FontFamily` on a Button and a ToggleButton — red before the fix,
  green after; a token lookup cannot see this gap.
- Record the seam rule in `specs/lessons.md` and the fix in the spec 09 progress notes.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01Gjq1PTgqHq3BtLLJbwiguk

* fix(simple): declare the button typeface aliases inside ThemeDictionaries

SimpleButtonFontFamily and SimpleToggleButtonFontFamily were declared at the
top level of Button.xaml / ToggleButton.xaml, so the generated font layer could
not reach them and a runtime DefaultFontFamily change left them on their
parse-time snapshot.

BaseTheme sets its own Source to mergedpages.xaml (BaseTheme.cs:505), so a
top-level key there is one of the theme dictionary's own resources — and own
resources beat MergedDictionaries. The generated layer arrives through
AddThemeDictionary, i.e. merged, so it can shadow a themed declaration but never
a non-themed one. DatePickerFlyoutPresenterFontFamily passed the same test
because it is declared themed, as are all twelve of Material's alias keys.

Declaring both aliases in the Light and Default blocks the two files already
have puts them where the generated layer can shadow them. Mirroring the aliases
into the generated dictionary's top level was tried first and does not work —
that dictionary is merged; its non-themed entries lose to the theme's own.

Depends on 0f9976c: with the setters still on {StaticResource} this move would
have left a parse-time reference dangling. All four consumers now use
{ThemeResource}, so the two commits are complementary halves.

Simple runtime tests, net10.0-desktop Release headless: 256 cases, 255 passed,
0 failed, 1 pre-existing skip (was 253/2/1). No new warnings.

* fix(themes): read generated spacing and shape tokens through ThemeResource

- Simple and Material v2 control styles read the runtime-generated `Space*` / `Radius*`
  tokens — directly or through per-control aliases such as `SimpleButtonCornerRadius` and
  `MaterialContentDialogPanelPadding` — with `{StaticResource}`, which snapshots at parse
  time, so a runtime `DefaultSpacing` / `DefaultDensity` / `DefaultCornerRadius` change
  regenerated the tokens but never reached a control.
- Rewrite all 98 such reads (78 Simple, 20 Material v2; 22 files) to `{ThemeResource}`,
  found by an alias-closure sweep rooted at the generated keys. Density constants are
  fixed values and are left as they are.
- Add `Given_DesignTokens.When_ScaleMeasuresChangeAtRuntime_Then_RealizedButtonFollows`
  (Simple head) and `…_RealizedContentDialogFollows` (Material head): red before, green
  after, both against the application theme and restored in `finally`.
- `doc/design-tokens.md`: the scale measures are runtime-settable, with the
  already-realized caveat and the theme-change-pass route, matching `DefaultFontFamily`.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Gjq1PTgqHq3BtLLJbwiguk

* ci: Set version to '9.0-dev.{height}'

Uno.Themes 8.0 has not shipped a stable release yet, so the 8.0 line stays
open on servicing/8.0 for the Uno 6.x-compatible packages. master moves to
9.0 for the Uno Platform 7.0 retarget, which is binary breaking.

* chore!: Target Uno.Sdk.Private 7.0 and net10.0

BREAKING CHANGE: library target frameworks move from net9.0 to net10.0.
Consuming apps must target .NET 10 or later.

Move every library project from `Uno.Sdk` to `Uno.Sdk.Private`, since no
public `Uno.Sdk` 7.x exists yet, and pin `7.0.0-dev.679` — the same build
`uno.toolkit.ui` targets, so the two libraries agree on the Uno surface.

Both `global.json` files have to move together. `src/samples/global.json`
is the one that governs a sample head built directly (`dotnet publish
src/samples/<head>`, which is what CI runs); the root file only governs a
solution build, where the SDK is resolved from the entry point. Leaving the
nested file on 6.7.0-dev.815 built the libraries against Uno 7 and the sample
heads against Uno 6.

`7.0.0-dev.679` is published to the shared `unoplatformdev` feed, so no
additional package source is required.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01TgSByQzKDng9vt79kCkRTC

* fix!: Retarget Uno.UI.Toolkit namespaces for BC53

BREAKING CHANGE: the `Uno.UI.Toolkit` xmlns is gone. XAML copied from these
styles must use `using:Uno.UI.Xaml.Controls` for `ElevatedView` and
`CommandBarExtensions`, `using:Uno.UI.Behaviors` for `VisibleBoundsPadding`,
and `using:Uno.UI.Xaml` for `UIElementExtensions`.

Uno 7.0 renames the `Uno.UI.Toolkit` assembly to `Uno.UI.Extras` and keeps
its types in their natural namespaces rather than moving them as a block, so
the single `toolkit` xmlns splits three ways.

`using:Uno.UI.Extras` is not a valid replacement, even though it compiles:
that namespace exists but its only public type is the generated
`GlobalStaticResources`, so the XAML generator emits type references to
`Uno.UI.Extras.ElevatedView` and `Uno.UI.Extras.VisibleBoundsPadding`, which
do not exist. Every affected template would fail at runtime instead of at
build time.

Map each usage to the namespace that actually owns the type, reusing the
`uno` prefix this repo already binds to `Uno.UI.Xaml.Controls`:

- `ElevatedView`, `CommandBarExtensions` -> `uno`
- `VisibleBoundsPadding`                 -> `unobehaviors`
- `UIElementExtensions`                  -> `unoxaml`

Verified by disassembling the built assemblies: the emitted type references
are now `Uno.UI.Xaml.Controls.ElevatedView` and
`Uno.UI.Behaviors.VisibleBoundsPadding`.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01TgSByQzKDng9vt79kCkRTC

* fix: Match a template child with a type pattern (BC26)

`GetTemplateChild<TControl>` constrained `TControl` to `class, DependencyObject`
under `HAS_UNO`. Uno 7.0 makes `DependencyObject` a class, so that pair is now
illegal (CS0450) — but simply dropping `class` breaks the other direction,
because `child as TControl` then needs a class constraint of its own (CS0413)
wherever `DependencyObject` is still an interface.

A type pattern needs no class constraint at all, so it compiles either way and
removes the dependency on how `DependencyObject` is declared.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01TgSByQzKDng9vt79kCkRTC

* fix(samples): Build the Android host through UnoPlatformHostBuilder

Uno 7.0 turns `NativeApplication.CreateHost()` into an abstract member and
drops the `Func<Application>` constructor overload, so the Android heads no
longer compile:

    error CS0534: 'Application' does not implement inherited abstract member
    'NativeApplication.CreateHost()'

Android has no managed entry point, so `CreateHost()` is where the host is
built — the equivalent of `Main` on the other targets.

Verified by compiling MaterialSampleApp for net10.0-android. A separate
pre-existing manifest issue remains on that target: the SDK's default
minSdkVersion 21 is below the 23 required by androidx.lifecycle.runtime.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01TgSByQzKDng9vt79kCkRTC

* chore(deps): Bump Uno.ShowMeTheXAML to 3.0.0-dev0001

2.0.0-dev0015 binds Uno.UI.Toolkit, which Uno 7.0 renamed to Uno.UI.Extras
and no longer ships, so the sample apps died at startup in the Hosting Smoke
and Runtime Tests jobs:

    System.IO.FileNotFoundException: Could not load file or assembly
    'Uno.UI.Toolkit, Version=255.255.255.255'
       at SkiaSharp.Views.Windows.GlobalStaticResources.Initialize()

3.0.0-dev0001 is the Uno 7.0 rebuild from unoplatform/ShowMeTheXAML#33,
published to nuget.org. Both packages move together since they share a
version line.

servicing/8.0 stays on 2.0.0-dev0015: that line is Uno 6.x-compatible and
3.0.0 targets net10.0 only.

* chore(deps): Bump Uno.Sdk.Private to 7.0.0-dev.697

`Uno.ShowMeTheXAML` 3.0.0-dev0001 depends on `Uno.WinUI` >= 7.0.0-dev.684,
so pinning the SDK at 7.0.0-dev.679 fails every head at restore:

    error NU1605: Detected package downgrade: Uno.WinUI from 7.0.0-dev.684
    to 7.0.0-dev.679

7.0.0-dev.697 also carries the XAML generator fix from unoplatform/uno#24457,
which clears the CS0407 `_View` return-type errors that blocked
`Uno.Simple.WinUI` on net10.0-android and net10.0-ios. Verified the fix is in
this package: its nuspec pins commit ee8ffda8, and the PR's merge commit
d5b9af48 is an ancestor of it.

Both `global.json` files move together, since the nested one governs a sample
head built directly, which is what CI does.

Verified by publishing the Material desktop head with the CI command: 0 errors.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01TgSByQzKDng9vt79kCkRTC

* fix(samples): Raise the Android minimum OS version to 24

The AndroidX libraries Uno 7 pins require API 23, so manifest merge fails on
every Android head:

    error XAAMM0000: uses-sdk:minSdkVersion 21 cannot be smaller than version
    23 declared in library [...] androidx.lifecycle.runtime

Uno raised its own SDK default to 24.0 in 4a29fb6a70, but this repo sets
`SupportedOSPlatformVersion` explicitly in `PlatformItemGroups.props`, and the
SDK default is guarded by `Condition="$(SupportedOSPlatformVersion) == ''"`.
The repo value therefore always wins and no package bump can fix it here.

Use 24.0 to match the new SDK default rather than the bare minimum of 23.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01TgSByQzKDng9vt79kCkRTC

* refactor!: Drop markup gated on the removed xamarin and skia prefixes

BREAKING CHANGE: the `MaterialMUXNavigationViewResetSplitViewStyle` resource
key is removed. It was declared `xamarin:`-only and is unreferenced in this
repository.

Uno 7.0 reworked the conditional XAML prefix vocabulary. The surviving set is
`android`, `ios`, `tvos`, `desktop`, `wasm`, `winappsdk`/`win` and their `not_`
forms; `xamarin`, `skia`, `macos`, `netstdref`, `not_mux` and `legacy` are gone.

Because every affected file also listed those prefixes in `mc:Ignorable`, the
markup they gated is now silently discarded rather than reported — it compiles
clean and applies on no platform at all. It was written for the native view
rendering that 7.0 removed, so there is nothing left for it to do:

- `<xamarin:Style>` / `<xamarin:VisualState>` / `<xamarin:Setter>` and the
  matching animation blocks in the Material and Cupertino control styles.
- `xamarin:ContentTemplateSelector`, `xamarin:Glyph`, `skia:Opacity`.
- `xamarin:Style="{StaticResource NativeDefaultFrame}"` in the samples shell —
  `NativeDefaultFrame` no longer exists in any Uno 7 assembly.

`xamarin:UseNativeStyle` is dropped with the rest, even though
`DatePicker.UseNativeStyle` and `TimePicker.UseNativeStyle` are still public:
the attribute only ever meant anything for the native pickers.

Deleting rather than remapping to `not_win:` keeps the change behavior
preserving. `not_win` covers desktop and WebAssembly as well as mobile, so a
remap would activate markup on platforms it never applied to.

Verified: all three desktop sample heads publish with 0 errors, all 17 touched
files parse as well formed XML, and the removed resource key has no remaining
references.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01TgSByQzKDng9vt79kCkRTC

* refactor: Sweep the conditional XAML prefixes for Uno 7

Uno 7 reworked the conditional prefix vocabulary, and this repo stacks a second
vocabulary of its own on top (`mobile`, `uwp`/`winui`, `lottie_*`, defined in the
four `*-common.props`). Resolution is keyed on the prefix NAME, not the URI, and a
prefix in neither the include nor the exclude list is silently discarded when it
appears in `mc:Ignorable` — so dead markup compiles clean and applies nowhere.

Three behavior-preserving passes.

1. Remove 122 unused prefix declarations across 59 files, with the matching
   `mc:Ignorable` tokens, dropping `mc:Ignorable` and `xmlns:mc` together where
   nothing was left. Only declarations with no corresponding usage were touched.

2. Collapse `macos:` / `not_macos:`. `macos` is in neither vocabulary, so its 16
   values were discarded; `not_macos` survives only because it happens to be
   declared as the presentation namespace rather than `http://uno.ui/not_macos`,
   which is why its values are the ones shipping. Delete the `macos` half, unwrap
   the `not_macos` half. The two must move together: at v1/PasswordBox.xaml,
   v1/TextBox.xaml and v2/TextBox.xaml, removing only `not_macos` would leave the
   control with no Padding at all.

   Also corrects doc/styles/TextBox.md, which documented `FilledTextBoxPadding` as
   the dead macOS value `16,7`; every platform actually gets `16,8`.

3. Collapse `uwp:` / `winui:`. Every library sets `FrameworkLineage=WinUI`, so the
   UWP arm is unreachable. `winui:UriSource` is what selects the Lottie assets, so
   it is unwrapped rather than deleted — removing both halves would strip
   `UriSource` from all four `LottieVisualSource` resources. The unreachable
   `<Choose>` blocks go with them, along with the `IsXamarinIOS`/`IsMonoAndroid`/
   `IsXamarinMac` LinkerConfig groups, the MacCatalyst plumbing and the
   `net10.0-maccatalyst` expansion, none of which Uno 7 can reach.

`ios:`, `android:`, `mobile:`, `win:`/`not_win:` and `lottie_not_win:` are all
still live and are left alone. `todo:` and the `contract*` ApiInformation
predicates are different mechanisms and are out of scope.

Verified: all four desktop sample heads publish with 0 errors, every touched file
parses as well formed XML, and no prefix that is still used lost its declaration.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01TgSByQzKDng9vt79kCkRTC

* refactor!: Retire the native-era platform forks in the Material styles

BREAKING CHANGE: the `MaterialTimePickerFlyoutPresenterStyle` and
`MaterialCommandBarElevation` resource keys are removed. Consumers using
`BasedOn` or `StaticResource` against either must drop the reference.

Uno 7.0 renders iOS and Android through Skia, so the `ios:` and `android:`
prefixes still apply but the native rendering they compensated for is gone.
These forks all had a native premise and no longer have one.

- CheckBox glyph nudge. The six `mobile:Margin="0,2,0,0"` offsets existed
  because the native renderer placed the glyph differently. All platforms now
  share the alignment commit acfb64b chose for the managed renderers.

- CheckBox press ripple. `DoubleAnimationUsingKeyFrames` was worked around on
  iOS for issue #361 with a plain `DoubleAnimation` in CommonStates. Uno 7
  deleted the Apple animator entirely (`f193975907`), so iOS and desktop now
  run the same `DispatcherDoubleAnimator` and the workaround is dead weight.
  Removing it also gives iOS a ripple on the unchecked-press transitions,
  which only ever had a `not_ios:` branch, and restores the Windows
  storyboards that `mc:Ignorable="ios not_ios"` was stripping.

- TimePicker flyout. The iOS presenter framed a native picker that no longer
  exists, leaving a Cancel/Done bar over an empty body and a dangling
  `IosPickerFlyoutTextButtonStyle` reference. iOS now uses the default
  presenter, which works.

- CommandBar. The iOS `Height="NaN"` and the Android-only 4dp elevation both
  encoded native chrome. Height matches the other platforms, and elevation is
  dropped to match v2, which never had it.

- RadioButton press ripple. The keyframe animation was gated `wasm:` inside a
  library that builds no browserwasm target framework, so it shipped nowhere
  and desktop, WebAssembly and Windows had an empty storyboard. It is now
  unconditional, replacing the per-platform `android:` and `ios:` workarounds.

- Samples. The Button padding pair collapses to the value that ships, and the
  Android-only hero `MinHeight` goes; the page already adapts by width.

`ios:Margin` on the v2 PasswordBox reveal glyph is deliberately left in place:
nothing ties it to native path bounds, so it needs a look on a device rather
than an inference.

Verified: all four desktop sample heads publish with 0 errors and every touched
file parses as well formed XML.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01TgSByQzKDng9vt79kCkRTC

* fix(ci): Pin the SDK to the one uno.check provisions

Provisioning wasm-tools downgrades the mono.toolchain.current manifest to
uno.check's own (10.0.101), while the pipeline installed the 10.0.102 SDK.
The workload resolver kept asking for Microsoft.NET.Runtime.MonoTargets.Sdk
10.0.2, which was never installed, so every net10.0-ios library build in the
packages stage failed with NETSDK1147. Invisible while the libraries targeted
net9.0, which resolves through the un-downgraded mono.toolchain.net9 manifest.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01MbHmxnFUWzjgeBQgdZGC1T

* chore: Target Uno.WinUI 7.0.0-dev.701

dev.701 moves Uno.UI.Adapter.Microsoft.Extensions.Logging onto
Uno.Core 5.0.0-dev.28, so the central 4.0.1 pins have to follow or
restore fails with NU1605.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01RjVqiGVHKGZyRLuy9SVMZi

* fix(samples): move samples to MSTest 4 with the runtime test engine (#1724)

The canary bumps Uno.UI.RuntimeTests.Engine to 2.0.0-dev.85, which requires
MSTest.TestFramework >= 4.3.3 while the samples pin 3.6.4. Restore fails with
NU1605 (warnings as errors) before anything compiles, in all 14 jobs:

  Warning As Error: Detected package downgrade: MSTest.TestFramework from
  4.3.3 to 3.6.4.
    MaterialSampleApp -> Uno.UI.RuntimeTests.Engine 2.0.0-dev.85 -> MSTest.TestFramework (>= 4.3.3)
    MaterialSampleApp -> MSTest.TestFramework (>= 3.6.4)

The engine and MSTest versions are coupled and have to move together: engine
2.0.0-dev.60 uses ExpectedExceptionAttribute, which MSTest 4 removed, and that
file ships as source inside the package, so it compiles into each sample app.
Bumping MSTest alone breaks the build on master.

MSTest 4 also introduces its own DescriptionAttribute, which is ambiguous with
System.ComponentModel.DescriptionAttribute used for the enum display names
(CS0104 in SourceSdk.cs and EnumHelper.cs).

Verified locally: with the canary's SDK versions (Uno.Sdk 7.0.0-dev.2,
Uno.Sdk.Private 7.0.0-dev.701) restore now succeeds on the Desktop and Android
heads, and master still builds with its own SDK pins.

Build: https://dev.azure.com/uno-platform/1dd81cbd-cb35-41de-a570-b0df3571a196/_build/results?buildId=233349&view=results

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>

* ci: enforce dotnet format and XAML Styler (#1725)

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>

---------

Co-authored-by: unodevops <[email protected]>
Co-authored-by: Steve Bilogan <[email protected]>
Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
Co-authored-by: DerekRaven <[email protected]>
Co-authored-by: agneszitte <[email protected]>
Co-authored-by: Agnès ZITTE <[email protected]>
Co-authored-by: Martin Zikmund <[email protected]>
MartinZikmund added a commit that referenced this pull request Sep 24, 2026
Every generated `_Bindings` class carried a weak-vs-strong reference switch on
the owner:

    #if UNO_HAS_UIELEMENT_IMPLICIT_PINNING
    private global::System.WeakReference _ownerReference;
    private MainPage Owner { get => (MainPage)_ownerReference?.Target; set => ... }
    #else
    private MainPage Owner { get; set; }
    #endif

The weak reference existed to stop an opaque native reference pinning a
`UIElement`-as-`UIView`. In 7.0 `UIElement` derives from `DependencyObject` on
every target and is never a native view, so there is nothing left to unpin.

`UNO_HAS_UIELEMENT_IMPLICIT_PINNING` is also defined in exactly one place —
`src/Uno.CrossTargetting.targets`, under `$(IsIOS)` / `$(IsTvOS)` — and that file
is repo-internal: no `build/` or `buildTransitive/` targets in any shipped
package define it. So SamplesApp's iOS/tvOS heads compile the weak branch while
every downstream app on iOS compiles the strong one. CI has been exercising an
ownership model no consumer ships, which is the same class of blind spot as the
`_View` alias in #24457, only inverted.

Collapse to the strong branch — the one every consumer already gets — and drop
the now-unread constant along with its entry in the constants list. Nothing else
in the repo references it.

38 expected-output files lose the 5-line block; no other generated text changes.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01GSKHVLNtHS6yTB5V3ww3d7
MartinZikmund added a commit that referenced this pull request Sep 25, 2026
Every generated `_Bindings` class carried a weak-vs-strong reference switch on
the owner:

    #if UNO_HAS_UIELEMENT_IMPLICIT_PINNING
    private global::System.WeakReference _ownerReference;
    private MainPage Owner { get => (MainPage)_ownerReference?.Target; set => ... }
    #else
    private MainPage Owner { get; set; }
    #endif

The weak reference existed to stop an opaque native reference pinning a
`UIElement`-as-`UIView`. In 7.0 `UIElement` derives from `DependencyObject` on
every target and is never a native view, so there is nothing left to unpin.

`UNO_HAS_UIELEMENT_IMPLICIT_PINNING` is also defined in exactly one place —
`src/Uno.CrossTargetting.targets`, under `$(IsIOS)` / `$(IsTvOS)` — and that file
is repo-internal: no `build/` or `buildTransitive/` targets in any shipped
package define it. So SamplesApp's iOS/tvOS heads compile the weak branch while
every downstream app on iOS compiles the strong one. CI has been exercising an
ownership model no consumer ships, which is the same class of blind spot as the
`_View` alias in #24457, only inverted.

Collapse to the strong branch — the one every consumer already gets — and drop
the now-unread constant along with its entry in the constants list. Nothing else
in the repo references it.

38 expected-output files lose the 5-line block; no other generated text changes.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01GSKHVLNtHS6yTB5V3ww3d7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/code-generation Categorizes an issue or PR as relevant to code generation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

XAML generator aliases _View to a native view type, breaking FrameworkTemplate builders on mobile (CS0407)

5 participants