From a25b5e6bc47a081292e380d2337b8615095a8fd7 Mon Sep 17 00:00:00 2001 From: Copilot App <223556219+Copilot@users.noreply.github.com> Date: Mon, 5 Oct 2026 15:16:34 -0700 Subject: [PATCH 1/2] Build Reactor's DataTemplates from code instead of parsing markup Reactor built two DataTemplates at runtime by handing XamlReader.Load a markup string: the ContentControl shell every items control mounts (ListView/GridView/FlipView), and the legacy text-node TreeView template. Both existed only because DataTemplate could not be constructed from code. WinUI now offers `new DataTemplate(DataTemplateElementFactory)`, which takes a callback returning the subtree. This ports both templates onto it, so Reactor no longer parses XAML at runtime for item templates. Beyond removing the parse, the TreeView template loses its `{Binding Content.Content}`. A classic Binding resolves that path by string through CsWinRT's ICustomPropertyProvider -- reflection, which NativeAOT trims unless the source type is annotated, and which costs a reflective lookup per realized row even when it works. Reading the same chain in a DataContextChanged handler is strongly typed: no annotation, no lookup, and the event re-fires on recycling so reused rows retext correctly. Windows App SDK versions move to the public experimental channel. The API is on nuget.org but still carries [feature(Feature_ExperimentalApi)], so it exists only there: it landed in Microsoft.WindowsAppSDK.WinUI 2.3.10-experimental and is absent from 2.3.9 stable. The 2.5.4-experimental metapackage is the aggregate that pairs with it (its nuspec names WinUI 2.3.10-experimental and pins Runtime [2.5.4-experimental]), so the pairing rule in spec 063 section 3 is satisfied and no package-reference workaround is needed. Two incidental fixes this SDK requires: * CS8305 is demoted from error to warning. The XAML compiler's *generated* XamlTypeInfo.g.cs references the SDK's own experimental metadata providers (XamlControlsCharts/XamlControlsTabular), so every WinUI project emits it from code we do not own. WarningsNotAsErrors rather than NoWarn, so a newly-introduced experimental dependency is still reported. * The IElementFactory cref in IItemsRepeaterFactorySource is disambiguated. This SDK adds Microsoft.UI.Xaml.IElementFactory alongside the existing Microsoft.UI.Xaml.Controls.IElementFactory, making the bare cref ambiguous (CS0419) and failing the warnings-as-errors Release build. Verified still required: restoring the bare cref reproduces the error. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 17bce8bb-d57a-4f76-a55d-27c9029fc9a3 --- Directory.Build.props | 36 ++++++++++++- .../Core/IItemsRepeaterFactorySource.cs | 2 +- src/Reactor/Core/Reconciler.cs | 50 ++++++++++++++----- 3 files changed, 73 insertions(+), 15 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index 3772db8ed..e5666e748 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -21,7 +21,19 @@ shape here. --> - 2.2.0 + + 2.5.4-experimental - 2.2.1 + 2.3.10-experimental 1.4.0 false @@ -71,6 +83,25 @@ true + + + $(WarningsNotAsErrors);CS8305 + +