Forum Xamarin.Forms
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

Binding does not work with listview

TuryBazzoTuryBazzo USMember ✭✭
edited December 2016 in Xamarin.Forms

I have a XAML (home.xaml):

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns=""

  <Label Text="{Binding titulo}"></Label>

    <ListView ItemsSource="{Binding simulados}">
                <Label Text="{Binding description}" />


And home.xaml.cs:

namespace AppLuterking.View
    public partial class Home : ContentPage
        public Home(aluno aluno)
            this.BindingContext = new HomeViewModel(aluno, this);


And my HomeViewModel.cs :

namespace AppLuterking.ViewModel
    public class HomeViewModel
        public string titulo { get; set; }

        public ObservableCollection<simulado> simulados { get; set; }

        public HomeViewModel(aluno aluno, ContentPage page)
            this.titulo = "Titulo 1";

            page.DisplayAlert("teste", "teste", "OK");


        private async void RetornaSimulados(aluno aluno)
            var cliente = new HttpClient();

            var uri = new Uri($"**********************************************************");

            var response = await cliente.GetAsync(uri);

            if (response.IsSuccessStatusCode)
                var content = await response.Content.ReadAsStringAsync();

                this.simulados = JsonConvert.DeserializeObject<ObservableCollection<simulado>>(content.ToString());


I using MVVM but my binding does not work, does anyone know why?

Best Answer


  • AlessandroCaliaroAlessandroCaliaro ITMember ✭✭✭✭✭
    What does it means that it does not work? There are items in the list? It's empty?
  • TuryBazzoTuryBazzo USMember ✭✭

    No, i not implement INotifyPropertyChanged.

    Do not load the Binding (titulo,simulados), my view load is empty.

    I tried to use list<> in place of ObservableCollection but not work :(

Sign In or Register to comment.