XAML-Map-Control/MapControl/Avalonia/MapItem.Avalonia.cs
2024-08-25 17:45:56 +02:00

23 lines
927 B
C#

// XAML Map Control - https://github.com/ClemensFischer/XAML-Map-Control
// Copyright © 2024 Clemens Fischer
// Licensed under the Microsoft Public License (Ms-PL)
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));
protected override void OnPointerPressed(PointerPressedEventArgs e)
{
(ItemsControl.ItemsControlFromItemContainer(this) as MapItemsControl)?
.OnItemClicked(this, e.KeyModifiers.HasFlag(KeyModifiers.Control));
}
}
}