how to pass a list between pages xamarin.forms?

Viewed 1655

I have a list of objects that should be passed to another view but I don't know how I can do that in Xamarin.forms, I think I should to use setBinding, but its the only thing I say in this case. Thank you.

List<Localizacao> localizacaoList = new List<Localizacao>(); ;
        if (localizacao != null && lojaPerto != null)
        {
            localizacaoList = new List<Localizacao>();
            Localizacao loc = new Localizacao();
            loc.latitude = Double.Parse(lojaPerto.latitude);
            loc.longitude = Double.Parse(lojaPerto.longitude);
            localizacaoList.Add(loc);
            localizacaoList.Add(localizacao);
        }

        var secondPage = new Views.ComoChegarView ();
        secondPage.BindingContext = localizacaoList;
        await Navigation.PushAsync(secondPage);

In fact, I sent, but I can't get it again in the other view

2 Answers
Related