XAML-Map-Control/MapControl/Avalonia/MapItem.Avalonia.cs
2025-03-13 19:34:07 +01:00

28 lines
909 B
C#

namespace MapControl
{
public partial class MapItem
{
public static readonly StyledProperty<bool> AutoCollapseProperty =
DependencyPropertyHelper.AddOwner<MapItem, bool>(MapPanel.AutoCollapseProperty);
public static readonly StyledProperty<Location> LocationProperty =
DependencyPropertyHelper.AddOwner<MapItem, Location>(MapPanel.LocationProperty, null,
(item, oldValue, newValue) => item.UpdateMapTransform(newValue));
/// <summary>
/// Prevent range selection by Shift+PointerPressed.
/// </summary>
protected override void OnPointerPressed(PointerPressedEventArgs e)
{
if (e.KeyModifiers.HasFlag(KeyModifiers.Shift))
{
e.Handled = true;
}
else
{
base.OnPointerPressed(e);
}
}
}
}