Open kunom opened 4 years ago
What is the MessagesFiltered
? A list or array ?
@varKeytrap MessagesFiltered
is of type ObservableCollection<SomeInternalT>
.
I'm having the same issue. Can't seem to figure out how to look at a property in an array, without it throwing up errors. {c:Binding 'Items.Count > 0 and !Items[0].SomeBool'}
behaves the same: it's functional, but it prints an ArgumentOutOfRangeException.
Consider the following binding expression:
{calc:Binding 'MessagesFiltered.Count > 0 ? MessagesFiltered[0] : null'}
When
MessagesFiltered
is empty, I see in the binding log the message below, which is exactly what the above binding expression tried to avoid.Is there the possibility to introduce lazy evaluation in such circumstances, or at least improve the error handling?
(Note: I also tried using a converter calling
Enumerable.FirstOrDefault()
, but then you lose the change tracking.)