title: How to load a Picker in Xamarin forms with data received from the Web Api?
body: <p>So, this is my Model Class &quot;Usuario&quot;</p>
  <p>This class has the Foreign key &quot;IdTipoUsuario&quot; that was declared in my database from SQL Server Management Studio. So I placed it here with the &quot;IList&quot; property:</p>
  <pre><code>namespace APPiGarbage.Models
  {
      public class Usuario
      {
          public int IdUsuario { get; set; }
          public string Nome { get; set; }
          public string Foto { get; set; }
          public string Descricao { get; set; }
          public string Email { get; set; }
          public string Senha { get; set; }
          public IList&lt;TipoUsuario&gt; TiposUsuarios { get; set; }
          
      }
  }
  </code></pre>
  <p>I have this other class TipoUsuario. This class has the &quot;Nome&quot; property that is supposed to be Binding in the picker.</p>
  <pre><code>namespace APPiGarbage.Models
  {
      public class TipoUsuario
      {
          public int IdTipoUsuario { get; set; }
          public string Nome { get; set; }
      }
  }
  </code></pre>
  <p>For my MVVM Model I tried whole lot codes and now I don't even know what to put in it. To be honest.</p>
  <pre><code>namespace APPiGarbage.ViewModel
  {
      public class UsuarioViewModel 
      {
          public List&lt;TipoUsuario&gt; tipos { get; set; }
  
          public List&lt;Usuario&gt; GetTipos()
          {
              var tipos = new List&lt;Usuario&gt;()
              {
  
              };
              return tipos;
          }
      }
  </code></pre>
  <p>For my ApiService class I have this code:</p>
  <pre><code>namespace APPiGarbage.API
  {
      public class ApiService
      {
          public const string Url = &quot;http://10.0.2.2:44342/&quot;;
          public static async Task&lt;List&lt;TipoUsuario&gt;&gt; ObterTipoUsuarios()
          {
              try
              {
                  HttpClient client = new HttpClient();
                  string url = Url + &quot;/api/TipoUsuario&quot;;
                  string response = await client.GetStringAsync(url);
                  List&lt;TipoUsuario&gt; tipos = JsonConvert.DeserializeObject&lt;List&lt;TipoUsuario&gt;&gt;(response);
                  return tipos;
              }
              catch (Exception)
              {
  
                  throw;
              }
          }
      }
  }
  </code></pre>
  <p>This is the Picker in my UsuarioPage.xaml:</p>
  <pre><code>&lt;Picker Title=&quot;Selecione o Tipo de Usuario&quot;
               ItemsSource=&quot;{Binding TipoUsuario}&quot;
               ItemDisplayBinding=&quot;{Binding Nome}&quot;/&gt;
  </code></pre>
  <p>And finally this is the UsuarioPage.xaml.cs:</p>
  <pre><code>namespace APPiGarbage.Pages.UsuarioPage
  {
      [XamlCompilation(XamlCompilationOptions.Compile)]
      public partial class UsuarioPage : ContentPage
      {
          public UsuarioPage()
          {
              InitializeComponent();
              BindingContext = new UsuarioViewModel();
          }
      }
  }
  
  </code></pre>
  <p>Thank you for taking your time to help me.</p>