XAML-Map-Control/MapControl/Avalonia/MapItem.Avalonia.cs
ClemensFischer 560f44a139 Copyright
2025-01-01 18:57:55 +01:00

23 lines
922 B
C#

// XAML Map Control - https://github.com/ClemensFischer/XAML-Map-Control
// Copyright © 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));
}
}
}