Bing地图控件-eventtocommand mouseleftbuttonup
小问题,我在 Windows Phone 7 视图上的 bing 地图控件中添加了一个图钉。 我有一个 EventTrigger EventName="MouseLeftButtonUp" 映射到我的视图模型上的命令。 因此,当我单击该图钉时,会触发视图模型中的代码。
但是,当我还将 EventTrigger EventName="MouseLeftButtonUp" 添加到 bing 地图本身时,只会触发该代码,并且忽略特定于图钉单击的代码。
那么,关于如何为 bing 地图父控件及其地图项控件添加单独的事件触发器,有什么建议吗?
Small question, I added a pushpin to a bing maps control on my windows phone 7 view.
I have an EventTrigger EventName="MouseLeftButtonUp" that maps to a command on my viewmodel.
So when I click that pushpin, my code in the viewmodel is triggered.
But when I also add EventTrigger EventName="MouseLeftButtonUp" to the bing map itself, only that code will be triggerd and the code specific for the pushpin click is ignored.
So any tips on how to add seperate eventriggers for the bing maps parent control and it's map item controls?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您要处理图钉上的点击事件,则不应为地图本身设置点击事件处理程序。
这个问题与事件的冒泡有关,对此你无能为力。另外,为什么您首先要在地图上进行点击事件?
You shouldn't have a Tap event handler for the Map itself, if you're handling tap-events on the PushPins.
The problem is related to the bubbling of events, which you can't do a awful lot about. Also, why would you want to have a tap-event on the map in the first place?