2026-02-01 22:56:50 +01:00
|
|
|
|
using Avalonia.Controls;
|
2025-08-19 19:43:02 +02:00
|
|
|
|
using Avalonia.Input;
|
|
|
|
|
|
|
|
|
|
|
|
namespace MapControl
|
2024-05-27 16:35:02 +02:00
|
|
|
|
{
|
|
|
|
|
|
public partial class MapItem
|
|
|
|
|
|
{
|
|
|
|
|
|
protected override void OnPointerPressed(PointerPressedEventArgs e)
|
|
|
|
|
|
{
|
2025-03-19 17:16:22 +01:00
|
|
|
|
if (e.Pointer.Type != PointerType.Mouse &&
|
|
|
|
|
|
ItemsControl.ItemsControlFromItemContainer(this) is MapItemsControl mapItemsControl)
|
2025-03-12 19:45:08 +01:00
|
|
|
|
{
|
2025-03-19 17:16:22 +01:00
|
|
|
|
mapItemsControl.UpdateSelection(this, e);
|
2025-03-13 19:34:07 +01:00
|
|
|
|
}
|
2025-03-19 11:14:13 +01:00
|
|
|
|
|
|
|
|
|
|
e.Handled = true;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected override void OnPointerReleased(PointerReleasedEventArgs e)
|
|
|
|
|
|
{
|
2025-03-19 17:16:22 +01:00
|
|
|
|
if (e.Pointer.Type == PointerType.Mouse &&
|
|
|
|
|
|
e.InitialPressMouseButton == MouseButton.Left &&
|
|
|
|
|
|
ItemsControl.ItemsControlFromItemContainer(this) is MapItemsControl mapItemsControl)
|
2025-03-13 19:34:07 +01:00
|
|
|
|
{
|
2025-03-19 17:16:22 +01:00
|
|
|
|
mapItemsControl.UpdateSelection(this, e);
|
2025-03-12 19:45:08 +01:00
|
|
|
|
}
|
2025-03-19 17:16:22 +01:00
|
|
|
|
|
|
|
|
|
|
e.Handled = true;
|
2024-05-27 16:35:02 +02:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|