title: Xamarin API Json List to ListView
body: <p>I have the following code
  Here's my properties:</p>
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Text;
  
  namespace ServLottery.Models
  {
      public class PendientesGiro
      {
          public int IDPendGiros { get; set; }
          public string NumFactura { get; set; }
          public double Monto { get; set; }
          public int IDPisteroVenta { get; set; }
          public int IDPisteroCanje { get; set; }
          public string Identification { get; set; }
          public string Nombre { get; set; }
          public string FechaVenta { get; set; }
      }
  }
  </code></pre>
  <p>Then the view model:</p>
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Collections.ObjectModel;
  using System.Text;
  
  namespace ServLottery.Models
  {
      public class PendGirosViewModel
      {
          public IList&lt;PendientesGiro&gt; PendientesLista { get; set; }
  
          public PendGirosViewModel()
          {
              try
              {
                  PendientesLista = new ObservableCollection&lt;PendientesGiro&gt;();
                  GetPendGiros();
              }
              catch (Exception ex)
              {
                  throw ex;
              }
          }
  
          private async void GetPendGiros()
          {
              try
              {
                  RestClient client = new RestClient();
                  var pend = await client.Get&lt;Models.PendientesGiro&gt;(&quot;https://servicentroapi.azurewebsites.net/api/Giros&quot;);
                  if (pend != null)
                  {
                      PendientesLista = pend;
                  }
              }
              catch (Exception ex)
              {
                  throw ex;
              }
  
          }
      }
  }
  
  </code></pre>
  <p>and the function I'm using to get the data back from the API</p>
  <pre><code>private async Task&lt;List&lt;PendientesGiro&gt;&gt; GetPendientesAsync()
          {
              List&lt;PendientesGiro&gt; PendientesLista = new List&lt;PendientesGiro&gt;();
              HttpClient client = new HttpClient();
              Uri uri = new Uri(string.Format(&quot;https://servicentroapi.azurewebsites.net/api/Giros&quot;, string.Empty));
              HttpResponseMessage response = await client.GetAsync(uri);
              if (response.IsSuccessStatusCode)
              {
                  string content = await response.Content.ReadAsStringAsync();
                  PendientesLista = JsonConvert.DeserializeObject&lt;List&lt;PendientesGiro&gt;&gt;(content);
                  Console.WriteLine(&quot;content :: &quot; + content);
                  Console.WriteLine(&quot;Data :: &quot; + PendientesLista);
              }
              return PendientesLista;
          }
  </code></pre>
  <pre><code>lv_Pend.ItemsSource = await GetPendientesAsync();
  </code></pre>
  <p>Info arrives to ItemsSource but is not being shown in the ListView, I think my problem is with the xaml code</p>
  <pre><code>&lt;ListView x:Name=&quot;lv_Pend&quot;
                        SelectedItem=&quot;{Binding PendientesGiro}&quot;
                        ItemsSource=&quot;{Binding PendientesGiro}&quot;&gt;
                  
                  &lt;ListView.ItemTemplate&gt;
                      &lt;DataTemplate&gt;
                          &lt;StackLayout Orientation=&quot;Horizontal&quot;&gt;
                              &lt;Label Text=&quot;{Binding Identification}&quot; TextColor=&quot;White&quot;/&gt;
                              &lt;Label Text=&quot;{Binding Name}&quot; TextColor=&quot;White&quot;/&gt;
                          &lt;/StackLayout&gt;
                      &lt;/DataTemplate&gt;
                  &lt;/ListView.ItemTemplate&gt;
                  
              &lt;/ListView&gt;
  </code></pre>
  <p>I want my list to show the identification and name and when I selected be able to take the entire set of date related to another page.</p>