简体   繁体   English

Windows Phone 8.1 MapIcon单击事件

[英]Windows Phone 8.1 MapIcon Click event

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. 我正在编写Windows Phone 8.1应用程序(Windows运行时版本),并且使用MapIcon类将图标放置在地图控件上。 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. 这是我第一次开发Windows Phone 8.1应用,因此非常感谢您提出任何建议。 Thank you. 谢谢。

万一有人在寻找适用于UWP应用程序的解决方案:现在有一个新的MapElementClick事件处理程序。

Instead of MapIcon you can place any XAML element on the map. 除了MapIcon之外,您还可以在地图上放置任何XAML元素。 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. 检查http://msdn.microsoft.com/zh-cn/library/windows/apps/xaml/dn792121.aspx#showing_xaml_controls_and_shapes_on_the_map由于它们是完整的XAML元素,因此您应该能够使用Tapped事件。

Also note that there is no guarantee that MapIcon objects will be displayed, they may be obscured by other elements. 还要注意,不能保证将显示MapIcon对象,否则可能会被其他元素遮盖。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM