{"$id":"1","Version":"1.0.0","dateTime":"2020/07/31 09:03:05","StatusCode":1,"ErrorMessage":"Success","Result":{"$id":"2","getpartnumberover":[{"$id":"3","partnumber":"14312-054-1","productname":"fill-line-hose-assy"}]}}
Please see the above json
Xaml Code
<ListView x:Name="MyListView" ItemsSource="{Binding MyListView}">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<StackLayout Orientation="Horizontal" Margin="5" HeightRequest="90">
<Label Text="{Binding partnumber}" TextColor="Black"></Label>
</StackLayout>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
Data is not getting bind and c# code is working fine but the mobile app is showing the blank page
What I have tried:
using (var httpClient = new HttpClient())
{
httpClient.DefaultRequestHeaders.TryAddWithoutValidation("Accept", "application/json");
httpClient.DefaultRequestHeaders.TryAddWithoutValidation("User-Agent", "Mozilla/5.0 (Windows NT 6.2; WOW64; rv:19.0) Gecko/20100101 Firefox/19.0");
var response = httpClient.GetAsync("APi url").Result;
string stud = response.Content.ReadAsStringAsync().Result;
JToken m = JToken.Parse(stud);
JArray men = (JArray)m.SelectToken("Result.over");
foreach (var zaq in men)
{
MyListView.ItemsSource = zaq.SelectToken("partnumber").ToString();
}
}