Repository navigation
Description
On which page? π
https://platform.uno/docs/articles/migrating-to-uno-7.html (source: doc/articles/migrating-to-uno-7.md)
What's wrong? β
The 7.0 migration guide doesn't mention that C# collection-initializer syntax on FrameworkElement and ContentControl no longer compiles.
PR #23744 (BC65 of the 7.0 breaking-changes rollup) removed the Uno-only IEnumerable implementation from FrameworkElement (and the redundant re-declaration on ContentControl), together with the Uno-only public Add(UIElement) helpers on Border, Panel and ScrollViewer. WinUI has neither. Together they were what made this compile:
var panel = new StackPanel { new TextBlock(), new Button() };
var border = new Border { new TextBlock() };
var viewer = new ScrollViewer { new Grid() };After the change this is a compile error (the type doesn't implement IEnumerable and has no Add). Code written in C# Markup style or hand-written C# UI is likely to hit it.
Checked on origin/master (0599dad) by code inspection, not by a build:
git grep -nE "class (FrameworkElement|ContentControl|Border|Panel|ScrollViewer)\b.*IEnumerable" -- src/Uno.UIfinds nothing, and there is noGetEnumeratorunder the Border / Panel / ScrollViewer folders.- The guide's Uno-only conversions section and migration checklist have no entry.
grep -inE "initializer|GetEnumerator|IEnumerable|BC65" doc/articles/migrating-to-uno-7.mdshows no relevant match.
Suggested fix: add a row to the "Uno-only implicit conversions and static fields removed" section (or a short section of its own), plus a checklist item:
| Removed | Replacement |
|---|---|
new StackPanel { a, b } (collection initializer on Panel) |
new StackPanel { Children = { a, b } } |
new Border { child } |
new Border { Child = child } |
new ScrollViewer { content } |
new ScrollViewer { Content = content } |
XAML is unaffected.
Any feedback? π¬
Separate from the missing ".NET 9 removal" docs gap tracked in #25328, which is a different omission from the same guide.
Activity
docs: Document the removed collection-initializer syntax in the 7.0 gβ¦