I am using Xamrin.Forms and MVVM. For the text of a label, I want to use the value of a properto of the first element of the collection of the main object of binding. I am trying this:
<Label Text="{Binding MainObject.Colleciton[0].MyProperty}" HorizontalTextAlignment="Start" TextColor="Black" FontSize="20" />
But I get the error that tells that object reference not set to an instance of an object when I try to compile.
The odd thing is that the intellisense detect MyProperty, so I don't know why it needed to set a reference, because normally when I set the binding, I have never get the case in which is check if the object is null or not.
How could I bind the property of the first item?
Thanks.