Xaml Windows phone-点击图像不工作?
我使用的是全景控制,上面有图像。我的XAML代码如下所示:Xaml Windows phone-点击图像不工作?,xaml,windows-phone,Xaml,Windows Phone,我使用的是全景控制,上面有图像。我的XAML代码如下所示: <Grid x:Name="LayoutRoot"> <Image Grid.Row="0" Source="/Images/khuyenmai.png" Height="85" Width="85" HorizontalAlignment="Right" x:Name="imgKhuyenMai" Tap="imgKhuyenMai_Tap" VerticalAlignment="Top" Margin="
<Grid x:Name="LayoutRoot">
<Image Grid.Row="0" Source="/Images/khuyenmai.png" Height="85" Width="85" HorizontalAlignment="Right" x:Name="imgKhuyenMai" Tap="imgKhuyenMai_Tap" VerticalAlignment="Top" Margin="305,5,41,0" RenderTransformOrigin="2.205,-6.523"></Image>
<phone:Panorama Grid.RowSpan="2" Margin="0,0,0,10">
<!--Panorama item one-->
<phone:PanoramaItem Header="item1">
<Grid/>
</phone:PanoramaItem>
<!--Panorama item two-->
<phone:PanoramaItem Header="item2">
<Grid/>
</phone:PanoramaItem>
</phone:Panorama>
</Grid>
我的问题是:“点击”事件不起作用?在网格中,当项目的Canvas.ZIndex相等时,后一个项目将覆盖前面的项目。例如,在您的代码中,“全景”将覆盖图像项,因此您不能点击它。有两种解决方案,您可以选择一种: 在图像上设置Canvas.ZIndex=1 或 更改代码的排序如下,将图像放在Panorama之后:
<Grid x:Name="LayoutRoot">
<phone:Panorama/>
<Image/>
</Grid>