Make clickable UI-elements for windows Phone 8.1 apps maps

試著忘記壹切 提交于 2019-12-11 13:05:09

问题


Windows Phone 8.1 App , C#

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.

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

I tried to just extend from Windows.UI.Xaml.Controls.Button , but those have not Location, probably because the 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.

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


回答1:


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.



来源:https://stackoverflow.com/questions/29395914/make-clickable-ui-elements-for-windows-phone-8-1-apps-maps

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!