Reputation: 101
I have one API which display meteo data on .xaml file like that:
<Label Text="{Binding Coord.Lon}"
Style="{StaticResource labelResultStyle}"
TextColor="White"
FontAttributes="Bold"
Grid.Row="2"
Grid.Column="0"
HorizontalOptions="CenterAndExpand"/>
For the second API I try to Binding Data lile that:
<Label Text="{Binding weatherForecast.MaxTemp}"
Style="{StaticResource labelResultStyle}"
FontAttributes="Bold"
HorizontalOptions="CenterAndExpand"
HorizontalTextAlignment="Start"
TextColor="White"/>
There is no result on the display.
My second Json object look like:
How should I call the data from the second object in the .xaml file ?
Upvotes: 0
Views: 35
Reputation: 89179
weatherForecast
is a collection of objects, so you have to specify which element of the collection you want to use
Text="{Binding weatherForecast[0].MaxTemp}"
Upvotes: 1