mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2025-12-06 07:12:04 +01:00
Update Map.Avalonia.cs
This commit is contained in:
parent
4c6322b193
commit
5294594846
|
|
@ -22,6 +22,9 @@ namespace MapControl
|
||||||
public Map()
|
public Map()
|
||||||
{
|
{
|
||||||
PointerWheelChanged += OnPointerWheelChanged;
|
PointerWheelChanged += OnPointerWheelChanged;
|
||||||
|
PointerPressed += OnPointerPressed;
|
||||||
|
PointerReleased += OnPointerReleased;
|
||||||
|
PointerMoved += OnPointerMoved;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
@ -56,10 +59,8 @@ namespace MapControl
|
||||||
cancellationTokenSource = null;
|
cancellationTokenSource = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnPointerPressed(PointerPressedEventArgs e)
|
private void OnPointerPressed(object sender, PointerPressedEventArgs e)
|
||||||
{
|
{
|
||||||
base.OnPointerPressed(e);
|
|
||||||
|
|
||||||
var point = e.GetCurrentPoint(this);
|
var point = e.GetCurrentPoint(this);
|
||||||
|
|
||||||
if (point.Properties.IsLeftButtonPressed)
|
if (point.Properties.IsLeftButtonPressed)
|
||||||
|
|
@ -69,10 +70,8 @@ namespace MapControl
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnPointerReleased(PointerReleasedEventArgs e)
|
private void OnPointerReleased(object sender, PointerReleasedEventArgs e)
|
||||||
{
|
{
|
||||||
base.OnPointerReleased(e);
|
|
||||||
|
|
||||||
if (mousePosition.HasValue)
|
if (mousePosition.HasValue)
|
||||||
{
|
{
|
||||||
e.Pointer.Capture(null);
|
e.Pointer.Capture(null);
|
||||||
|
|
@ -80,10 +79,8 @@ namespace MapControl
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnPointerMoved(PointerEventArgs e)
|
private void OnPointerMoved(object sender, PointerEventArgs e)
|
||||||
{
|
{
|
||||||
base.OnPointerMoved(e);
|
|
||||||
|
|
||||||
if (mousePosition.HasValue)
|
if (mousePosition.HasValue)
|
||||||
{
|
{
|
||||||
var position = e.GetPosition(this);
|
var position = e.GetPosition(this);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue