none
Tapped event being handled by both Pushpin handler and Map handler. RRS feed

  • Question

  • I have an app with a map.  The map has a tapped event handler which creates a new pushpin.  The new pushpin also has a tapped event handler.  If I tap on the pushpin, both of these handlers get called.  What I'd like to happen is that if the pushpin gets tapped only the pushpin event handler is called.

    I feel like I'm missing something simple.

    Thanks.

    Friday, August 24, 2012 4:20 AM

Answers

  • Are you setting e.Handled to true in the pushpin tapped event handler? If not the event will continue to bubble up.
    • Marked as answer by MercyCoach Friday, August 24, 2012 7:23 PM
    Friday, August 24, 2012 4:34 PM

All replies

  • Are you setting e.Handled to true in the pushpin tapped event handler? If not the event will continue to bubble up.
    • Marked as answer by MercyCoach Friday, August 24, 2012 7:23 PM
    Friday, August 24, 2012 4:34 PM
  • I knew there was something simple I was missing.  However, "Handled" isn't a member of the RoutedEventsClass in the Metro Windows.Ui.Xaml namespace.

    Friday, August 24, 2012 7:18 PM
  • Alright.  Got it.  Inadvertently mixing TappedRoutedEventArgs  with RoutedEventArgs.  

    Thanks Kristoffer.

    Friday, August 24, 2012 7:23 PM