void HtmlCanvas_RightTapped(object sender, RightTappedRoutedEventArgs e) #endif { // Get the cursor position relative to this HtmlCanvas #if MIGRATION Point pos = e.GetPosition(this); #else Point pos = e.GetCurrentPoint(this).Position; #endif // Get a stack of the HtmlCanvasElement directly under the cursor and all his parents // (Parent1, Parent2, ..., ElementDirectlyUnderTheCursor) Stack <HtmlCanvasElement> elements = GetPointedElements(this, pos.X, pos.Y); HtmlCanvasPointerRoutedEventArgs e2 = new HtmlCanvasPointerRoutedEventArgs(e, this); // Loop backward on every element of the stack while (!e.Handled && elements.Count > 0) { // Remove the last element of the stack and call its OnPointerMoved() method var el = elements.Pop(); el.OnRightTapped(e2); } }