Domanda

I plot a bunch of MapPolygons and set a Tapped listener for when one is clicked

polygon.Tapped += polygon_Tapped;

but when that gets called how do I know what one was tapped so I can display data associated with it?

For example in a Pushpin I could set data in the .Tag but that is not available for a polygon. I see that in the TappedRoutedEventArgs there is an OriginalSource object which would give me a reference to the object that raised the event but I still wont be able to associate data with that polygon.

the only thing I can think of is using a Dictionary to keep a reference to the object and check if the object equals the object clicked in a loop.

any ideas?

È stato utile?
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top