Skip to content

Migrating to Uno 7.0 guide does not mention removed C# collection-initializer syntax on panels, Border and ScrollViewerΒ #25329

Closed

Description

@MartinZikmund

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.UI finds nothing, and there is no GetEnumerator under 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.md shows 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

  1. added
    good first issue
    triage/untriaged
    project/layout 🧱
    project/documentation πŸ“–
    difficulty/starter πŸš€
    kind/breaking-change πŸ’₯
    project/csharp-markup
    on Oct 12, 2026
  2. added a commit that references this issue on Oct 14, 2026
    12bb406
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    difficulty/starter πŸš€good first issuekind/breaking-change πŸ’₯kind/consumer-experiencekind/documentationproject/csharp-markupproject/documentation πŸ“–project/layout 🧱triage/untriaged

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions