I saw this piece of code in an example of some Xamarin code:
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<Label Text="{Binding .}" TextColor="#66ffff" FontSize="Micro" HorizontalOptions="CenterAndExpand" />
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
What does Binding . mean? My guess from trying out the code is one character from the ItemsSource like in a regular expression? But I can't find this in the documentation.
The point (.) means that you bind the whole object/ model instead of a single property to the text property of that label. This is sometimes required, for example you need multiple aspects from your model in a converter.
In this code example above, it also could be that the item source for that listview is a list of strings. So there is no property to bind to the text property.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With