| イベント | 発生タイミング |
|---|---|
| Tapped | この要素のヒットテスト領域で、未処理のタップ操作が行われたとき |
| DoubleTapped | an otherwise unhandled DoubleTap interaction occurs over the hit test area of this element. |
| DragEnter | the input system reports an underlying drag event with this element as the target. |
| DragLeave | the input system reports an underlying drag event with this element as the origin. |
| DragOver | the input system reports an underlying drag event with this element as the potential drop target. |
| Drop | the input system reports an underlying drop event with this element as the drop target. |
| GotFocus | a UIElement receives focus. |
| Holding | an otherwise unhandled Hold interaction occurs over the hit test area of this element. |
| KeyDown | a keyboard key is pressed while the UIElement has focus. |
| KeyUp | a keyboard key is released while the UIElement has focus. |
| LostFocus | a UIElement loses focus. |
| ManipulationCompleted | a manipulation on the UIElement is complete. |
| ManipulationDelta | the input device changes position during a manipulation. |
| ManipulationInertiaStarting | the input device loses contact with the UIElement object during a manipulation and inertia begins. |
| ManipulationStarted | an input device begins a manipulation on the UIElement. |
| ManipulationStarting | the manipulation processor is first created. |
| PointerCanceled | a pointer that made contact abnormally loses contact. |
| PointerCaptureLost | pointer capture previously held by this element moves to another element or elsewhere. |
| PointerEntered | a pointer enters the hit test area of this element. |
| PointerExited | a pointer leaves the hit test area of this element. |
| PointerPressed | この要素内でマウスがクリックされるか、指が触れたとき |
| PointerMoved | この要素のヒットテスト領域内で、ポインタが移動したとき |
| PointerReleased | the pointer device that previously initiated a Press action is released, while within this element. |
| PointerWheelChanged | the delta value of a pointer wheel changes. |
| RightTapped | a right-tap input stimulus happens while the pointer is over the element. |
ClickやDoubleTappedなどのイベントは、デバイスに依存しません。
Panelを継承するクラスでTappedやPointerPressedをハンドルするには、Backgroundプロパティを設定する。
public delegate void TappedEventHandler(
object sender,
TappedRoutedEventArgs e
)
タップされた位置を取得するには、
Windows.Foundation.Point point
= e.GetPosition((Windows.UI.Xaml.UIElement)sender);
とします。