Windows Phone 8.1 MapIcon点击事件 [英] Windows Phone 8.1 MapIcon Click event

查看:201
本文介绍了Windows Phone 8.1 MapIcon点击事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写Windows Phone 8.1应用程序(Windows Runtime版本),并且我使用MapIcon类将图标放在地图控件上。但是,我希望这些图标可以对点击事件做出反应,以便在用户点击特定图标后可以显示更多详细信息。我上了谷歌,找不到答案。是否可能,或者我必须创建自己的课程才能实现这一目标(以及如何)?



这是我第一次开发Windows Phone 8.1应用程序,所以任何建议都是非常感激的。谢谢。

解决方案

而不是MapIcon,您可以在地图上放置任何XAML元素。请查看 http://msdn.microsoft.com/ en-us / library / windows / apps / xaml / dn792121.aspx#shows_xaml_controls_and_shapes_on_the_map
由于它们是完整的XAML元素,因此您应该可以使用Tapped事件。



另请注意,不能保证MapIcon对象将被显示,它们可能被其他元素遮挡。


I'm writing a Windows Phone 8.1 app(Windows Runtime version), and I used the MapIcon class to place the icons on the map control. However, I hope these icons can react to the "click" event so that I could show more details after a user has clicked a specific icon. I googled and wasn't able to find an answer. Is it possible, or do I have to create my own class in order to achieve this goal(and how)?

It's my first time to develop the Windows Phone 8.1 app, so any suggestions are really appreciated. Thank you.

解决方案

Instead of MapIcon you can place any XAML element on the map. Check http://msdn.microsoft.com/en-us/library/windows/apps/xaml/dn792121.aspx#showing_xaml_controls_and_shapes_on_the_map Since they are full blown XAML elements, you should be able to use Tapped event.

Also note that there is no guarantee that MapIcon objects will be displayed, they may be obscured by other elements.

这篇关于Windows Phone 8.1 MapIcon点击事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆