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?

Upvotes: 9

Views: 4407

Answers (1)

Rico Suter
Rico Suter

Reputation: 11868

Set Background="Transparent" in your Grid.

Upvotes: 32

Related Questions