XAML-Map-Control/MapControl/Avalonia/MapItem.Avalonia.cs
ClemensFischer 5074ce8d82 Version 10.2
2024-05-28 08:04:58 +02:00

23 lines
971 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), e.KeyModifiers.HasFlag(KeyModifiers.Shift));
}
}
}