Update Map.WinUI.cs

This commit is contained in:
ClemensFischer 2025-06-13 16:17:22 +02:00
parent efc73292ba
commit eaf3ff05fa

View file

@ -20,7 +20,6 @@ namespace MapControl
| ManipulationModes.TranslateInertia; | ManipulationModes.TranslateInertia;
PointerWheelChanged += OnPointerWheelChanged; PointerWheelChanged += OnPointerWheelChanged;
PointerPressed += OnPointerPressed;
PointerMoved += OnPointerMoved; PointerMoved += OnPointerMoved;
ManipulationDelta += OnManipulationDelta; ManipulationDelta += OnManipulationDelta;
ManipulationCompleted += OnManipulationCompleted; ManipulationCompleted += OnManipulationCompleted;
@ -40,20 +39,8 @@ namespace MapControl
private bool? manipulationEnabled; private bool? manipulationEnabled;
private void OnPointerPressed(object sender, PointerRoutedEventArgs e)
{
// Set manipulationEnabled before ManipulationStarted.
// IsLeftButtonPressed: input was triggered by the primary action mode of an input device.
//
manipulationEnabled =
e.GetCurrentPoint(this).Properties.IsLeftButtonPressed &&
e.KeyModifiers == VirtualKeyModifiers.None;
}
private void OnPointerMoved(object sender, PointerRoutedEventArgs e) private void OnPointerMoved(object sender, PointerRoutedEventArgs e)
{ {
// Set manipulationEnabled before ManipulationStarted when no PointerPressed was received.
//
if (!manipulationEnabled.HasValue && if (!manipulationEnabled.HasValue &&
e.GetCurrentPoint(this).Properties.IsLeftButtonPressed) e.GetCurrentPoint(this).Properties.IsLeftButtonPressed)
{ {