Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is my Grid Tapped event not being called?

It's true that I'm not actually tapping in the simulator - as my dev machine is not touch-enabled - but I don't think that's the problem, as my clicking within the grid should fire the event.

Here's my xaml:

<Grid x:Name="grid1" Margin="24,0,0,0" Grid.Row="1" Tapped="Grid_OnTapped">

...and my code:

private void Grid_OnTapped(object sender, TappedRoutedEventArgs args)
{
     if (args.OriginalSource.Equals(grid1))
     {
    . . .

I never make it to the Grid_OnTapped event. What am I missing?

like image 897
B. Clay Shannon-B. Crow Raven Avatar asked Nov 16 '12 19:11

B. Clay Shannon-B. Crow Raven


1 Answers

Set Background="Transparent" in your Grid.

like image 172
Rico Suter Avatar answered Oct 23 '22 10:10

Rico Suter