문제

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?

도움이 되었습니까?
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top