Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [{"prodName":"abc","qty":142.0,"price":110.0},
- {"prodName":"efg","qty":20.0,"price":900.0}]
- <ListView x:Name="ProductsListView">
- <ListView.ItemTemplate>
- <DataTemplate>
- <ViewCell>
- <StackLayout Orientation="Horizontal">
- <Label Text="{Binding prodName}" TextColor="Black"></Label>
- <Label Text="{Binding price}" TextColor="Black"></Label>
- </StackLayout>
- </ViewCell>
- </DataTemplate>
- </ListView.ItemTemplate>
- </ListView>
- private async void GetProducts()
- {
- HttpClient client = new HttpClient();
- var response = await client.GetStringAsync("http://myUrl/Api/Values");
- var products = response;
- ProductsListView.ItemsSource = products;
- }
Add Comment
Please, Sign In to add comment