question

DavidPritchard-6904 avatar image
0 Votes"
DavidPritchard-6904 asked DavidPritchard-6904 commented

x:Bind limit of ~128 per XAML file in C++/CX

If I make a XAML file in C++/CX with 128 {x:Bind} statements, I get a compiler error:

fatal error C1061: compiler limit: blocks nested too deeply

It occurs in the GeneratedFiles code, in the .g.hpp file's Disable() method, which consists of ~128 if/else statements in a row. (Actually seems to be a limit of 123, not 128.)

The only solutions are to:
a) split up the XAML file into multiple components
b) use {Binding} instead of {x:Bind}

This would be trivial to fix via either:
- changing code generation to just use a series of if statements instead of if/else
- or, via a switch statement with ((lineNumber << 32) | (columnNumber & 0xffffffff))

It appears to work fine in C# or C++/WinRT.

A simple example: the default C++/CX UWP template, with 128 of these:
<Button Content="{x:Bind S}"/>

and a simple string property:
property Platform::String^ S {
Platform::String^ get() { return L"S"; }
}

windows-uwpc++windows-uwp-feedback
· 4
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

It looks you have found the solution, Could tell what's your current problem ?

0 Votes 0 ·

Well - it's a poor solution. x:Bind is a "headline" feature of the UWP platform over traditional WPF; it should work!

Microsoft can easily fix this. There is no Microsoft platform-tools bug-reporting facility any more, other than this forum, so... here I am.

0 Votes 0 ·

ok got it, Please feel free post this with windows feed back hub app. And I will help to escalate this problem too.

1 Vote 1 ·
Show more comments

0 Answers