Open Belafon opened 9 months ago
This is probably because the compiler can't tell that you don't intend for just a string input which is an array of chars.
I do not see the background of that, but still I guess there has to be some pareser, that parses the array of chars and which can complain about wrong structure of it.
But I get that solving this problem is not very important.
"(Binding Library.AllTypes}" is a string. String is an array. Array is a valid value for ItemsSource.
At best, we can add a warning to help find these issues.
XAML warnings feature isn't yet implemented in XAMLX compiler, but I have working on it this month. I expect it to be available for 11.2 or 11.1.x builds, as I am focused on other issues for 11.1.
On a side note you can sometimes see XAML binding errors at runtme in the output. Since these are just regular exceptions you can also configure your IDE to break on them. Which often shows you the exact line the error is on. But I agree, tracking down XAML errors is a pain. Especially without an IDE.
I spent almost an hour looking for the error in my xaml code until I found that the problem was only in one curly bracket. I had written "(" instead of "{", ItemsSource="(Binding Library.AllTypes}". The problem was that the compiler didn't find the error. It was an AutoCompleteBox which then recommended some selected letters).
The problem was really annoying, if only because both parentheses are almost unrecognizable when the text is zoomed out.