开发者

WP7 - Detect 'Click' event on a MapPolygon

开发者 https://www.devze.com 2023-04-08 03:34 出处:网络
I am developing an app for windows phone 7. I have an overlay on the standard Map object that contains several MapPolygon obje开发者_Go百科cts.

I am developing an app for windows phone 7.

I have an overlay on the standard Map object that contains several MapPolygon obje开发者_Go百科cts.

What is the best and/or simplest solution for knowing if the user has tapped one of the polygons?


Using the Silverlight Toolkit is probably the easiest way to do it. Once added to your project use the gesture listener like so:

var gestureListener = GestureService.GetGestureListener(poly);
gestureListener.Tap += new EventHandler<GestureEventArgs>(gestureListener_Tap);

Where gestureListener_Tap is the method called.

0

精彩评论

暂无评论...
验证码 换一张
取 消