为 windows Phone 8.1 应用程序制作可点击的 UI 元素地图 [英] Make clickable UI-elements for windows Phone 8.1 apps maps

查看:23
本文介绍了为 windows Phone 8.1 应用程序制作可点击的 UI 元素地图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Windows Phone 8.1 应用程序,C#

Windows Phone 8.1 App , C#

我想让用户将图钉(显然称为 MapIcons )添加到地图,当用户单击新创建的图钉时,应该会出现一些其他 ui 元素.

I would like to let the user add Pushpins ( which apparently are called MapIcons ) to the map and when the user clicks the newly created Pushpin some other ui-elements should appear.

但显然 MapIcons 不可点击,由于它们是密封的,因此您无法从它们继承,因此无法使它们可点击.

But apparently MapIcons are not clickable and you can not inherit from them since they are sealed, so no luck in making them clickable.

我试图从 Windows.UI.Xaml.Controls.Button 扩展,但那些没有位置,可能是因为它们不属于 Windows.UI.Xaml.Controls.Maps 命名空间.所以我不能真正将它们添加到 Windows.UI.Xaml.Controls.Maps.MapControl.Children 或 Windows.UI.Xaml.Controls.Maps.MapControl.MapElements,因为它们不会在我想要它们的地图上成为.

I tried to just extend from Windows.UI.Xaml.Controls.Button , but those have not Location, probably because they do not belong to the Windows.UI.Xaml.Controls.Maps-namespace. So I can not really add them to the Windows.UI.Xaml.Controls.Maps.MapControl.Children or Windows.UI.Xaml.Controls.Maps.MapControl.MapElements, since they will not be on the map where I would want them to be.

那么你如何制作一个可点击的 ui 元素,我可以在地图上给出一个位置?

So how do you make a clickable ui-element that I can give a location on the map?

推荐答案

你可以在那里扔任何你想要的东西,只要它们是对象放置的子项,只需绑定到 MapControl.Location 附加属性即可映射父级.

You can throw pretty much anything you want on there and just bind to the MapControl.Location attached property for the object placement as long as they're children of a map parent.

查看更多详细说明此处 在文档中.

See more detail explanation here in the docs.

这篇关于为 windows Phone 8.1 应用程序制作可点击的 UI 元素地图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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