Guest User

Untitled

a guest
Apr 24th, 2018
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. [{"prodName":"abc","qty":142.0,"price":110.0},
  2. {"prodName":"efg","qty":20.0,"price":900.0}]
  3.  
  4. <ListView x:Name="ProductsListView">
  5. <ListView.ItemTemplate>
  6. <DataTemplate>
  7. <ViewCell>
  8. <StackLayout Orientation="Horizontal">
  9.  
  10. <Label Text="{Binding prodName}" TextColor="Black"></Label>
  11. <Label Text="{Binding price}" TextColor="Black"></Label>
  12. </StackLayout>
  13. </ViewCell>
  14. </DataTemplate>
  15. </ListView.ItemTemplate>
  16. </ListView>
  17.  
  18. private async void GetProducts()
  19. {
  20. HttpClient client = new HttpClient();
  21.  
  22. var response = await client.GetStringAsync("http://myUrl/Api/Values");
  23. var products = response;
  24. ProductsListView.ItemsSource = products;
  25.  
  26.  
  27. }
Add Comment
Please, Sign In to add comment