ListView on customPin onClick in Xamarin.Forms.Maps

0

I created an app in Xamarin.Forms with personalized pins, and clicking on them leaves a small window with the desired layout.

The problem I have is that I want that layout to contain a listview with several elements, but I am not able to create the adapter, because I am not able to pass the Activity correctly.

The code of my application is analogous to this project: link

Where I have the problem is in the Droid / CustomMapRenderer.cs class, in the GetInfoContents function. There after the Exception ("Custom pin not found") I do the following:

view = inflater.Inflate(Resource.Layout.infoParada, null);
Android.Widget.ListView listView = FindViewById<Android.Widget.ListView>(Resource.Id.List); // get reference to the ListView in the layout
TextView heading = view.FindViewById<TextView>(Resource.Id.Heading);
heading.Text = marker.Title;
List<Parada> lParadas = new List<Parada>();
// rellenar lista
listView.Adapter = new ParadaAdapter((Activity)this.context, lParadas);
return view

In theory, everything is well built, if I comment on the Adapter line, I create the page by clicking on the pin, and it gives me the corresponding title.

I would appreciate if someone can tell me what I have to pass as the first parameter in the newParadaAdapter.

    
asked by ugeltroglodita 12.07.2018 в 11:36
source

0 answers