You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Can't bind array to ItemsSource when using C++/WinRT #4119
When using C++/WinRT, binding to ItemSource using x:Bind doesn't work as it generates a C# style array which won't work in C++, instead use winrt::array_view.
Steps to reproduce the bug
Steps to reproduce the behavior:
Define an array in IDL
Bind it to a XAML control
See error
Expected behavior
x:Bind should work with an array
You mentioned that you would like this reopened, so I'm just getting some background. You also mentioned this is a duplicate of #7929, but that issue is closed. Is this not a duplicate, or is that issue closed incorrectly?
Reporter says x:Bind to an IDL-defined array used as ItemsSource fails in C++/WinRT because generated code uses a C#-style array instead of winrt::array_view. Follow-ups report the same failure in a desktop C++ project, and no workaround is mentioned.
🧪 Investigation details
Reproduction: ✅ Sufficient detail for initial investigation
Issue Type plan: Set the missing repository Type to Bug.
WinUI project priority assessment:P1. Reporter states x:Bind to an IDL-defined array used as ItemsSource fails in C++/WinRT; no workaround is reported. Error text appears only in a screenshot. Follow-up says a desktop C++ project is also affected. Existing project values take precedence; publication requires configured project access.
Routing at assessment time (existing labels preserved):area-Binding, area-C++/WinRT, team-Core, team-Markup.
Suggested area:area-Binding (high confidence).
Routing rationale: Reporter diagnoses x:Bind code generation for ItemsSource arrays as producing C#-style array code that does not work in C++/WinRT, placing the failure at the Binding boundary. Existing area-Binding label retained; diagnosis is unverified.
AI-assisted automated triage; WinUI maintainers make final decisions. Routing above is an assessment-time snapshot; later maintainer label changes take precedence. Existing labels are preserved; this workflow never closes issues automatically.
Activity
StephenLPeters commentedon Feb 9, 2021
Kenny Kerr (@kennykerr) FYI, Is this a cppwinrt issue or a xaml compiler issue?
StephenLPeters commentedon Feb 9, 2021
Tommy Klein (@RealTommyKlein) and FabianT (@fabiant3) FYI
kennykerr commentedon Feb 9, 2021
That code is not generated by cppwinrt.
RealTommyKlein commentedon Feb 9, 2021
Stephen L Peters (@StephenLPeters) it's an issue in the Xaml compiler's generated code
JeanRoca commentedon Mar 10, 2021
@Jaiganeshkumaran does this issue occur in a Desktop project as well?
JeanRoca commentedon Apr 14, 2021
No further information provided, closing for now. Feel free to reopen if there is more info.
jgkumaran commentedon May 22, 2021
Yes this seems to happen in a desktop project as well however only when you use C++. Works fine with C#.
9 remaining items
jgkumaran commentedon Feb 7, 2024
Yes, it very much does; please fix it soon.
bpulliam commentedon Feb 29, 2024
You mentioned that you would like this reopened, so I'm just getting some background. You also mentioned this is a duplicate of #7929, but that issue is closed. Is this not a duplicate, or is that issue closed incorrectly?
jgkumaran commentedon Feb 29, 2024
Bob Pulliam (@bpulliam) That issue is in fact a duplicate, but the author closed it because this issue was open at that time.
Repro microsoft/microsoft-ui-xaml#4119
hoshiizumiya commentedon Nov 15, 2026
Tommy Klein (@RealTommyKlein) Jesse Collins (@JesseCol) Reopen please. Still reproducible.
github-actions commentedon Nov 16, 2026
Thank you for taking the time to file this issue and help improve WinUI.
🧭 Triage summary
🛠️ For the WinUI team
🧩
area-Binding,area-C++/WinRT· 👥team-Core,team-Markup· 🐞 BugReporter says x:Bind to an IDL-defined array used as ItemsSource fails in C++/WinRT because generated code uses a C#-style array instead of winrt::array_view. Follow-ups report the same failure in a desktop C++ project, and no workaround is mentioned.
🧪 Investigation details
Bug.P1. Reporter states x:Bind to an IDL-defined array used as ItemsSource fails in C++/WinRT; no workaround is reported. Error text appears only in a screenshot. Follow-up says a desktop C++ project is also affected. Existing project values take precedence; publication requires configured project access.area-Binding,area-C++/WinRT,team-Core,team-Markup.area-Binding(high confidence).needs-triage).AI-assisted automated triage; WinUI maintainers make final decisions. Routing above is an assessment-time snapshot; later maintainer label changes take precedence. Existing labels are preserved; this workflow never closes issues automatically.