1

我正在创建一个 windows phone 7.1 应用程序,并且我正在尝试在地图上设置图像。所以我设法创建了地图视图并且它正在工作,我在它上面设置了一个图像(我正在使用网格控件,并且我Grid.row = 0在我的 XAML 代码中同时给出了地图和图像,所以它们出现在另一个之上)。问题是因为图像在地图上方,我无法点击或点击或拖动地图。我猜图像正在捕捉 onclick 事件,它阻止它到达地图。

任何想法如何使地图可访问?当一个东西堆叠在一起时,网格是正确的东西吗?

谢谢!

4

1 回答 1

1

You should try to set the IsHitTestVisible property of the Image to false:

<Image IsHitTestVisible="False">

From MSDN:

If this property is set to false, a UIElement will not report any input events, such as MouseLeftButtonDown, and cannot receive focus. A routed input event that was originated by a different object can still route to or through an object in the object tree where IsHitTestVisible is false. The object where IsHitTestVisible is false can choose to handle that event, or can leave it unhandled so that it routes further up the object tree.

于 2013-02-07T15:32:43.843 回答