public GetCurrentPoint ( [ relativeTo ) : |
||
relativeTo | [ | |
return |
private void Canvas_PointerMoved(object sender, PointerRoutedEventArgs e) { PointerPoint pointerPoint = e.GetCurrentPoint(Canvas); // Do something with the pointerPoint object, such as getting its position: double x = pointerPoint.Position.X; double y = pointerPoint.Position.Y; }
private void StackPanel_PointerPressed(object sender, PointerRoutedEventArgs e) { PointerPoint pointerPoint = e.GetCurrentPoint(StackPanel); // Do something with the pointerPoint object, such as getting its pressure and button state: bool primaryButtonPressed = pointerPoint.Properties.IsLeftButtonPressed; bool pressureDetected = pointerPoint.Properties.Pressure > 0; }Package library: The PointerRoutedEventArgs class belongs to the Windows.UI.Xaml.Input namespace, which is part of the Windows Runtime API. As such, it is included in the Windows 10 SDK library.
public GetCurrentPoint ( [ relativeTo ) : |
||
relativeTo | [ | |
return |