XAML-Map-Control/MapControl/Avalonia/MapItem.Avalonia.cs

29 lines
1 KiB
C#
Raw Normal View History

2024-05-27 16:35:02 +02:00
// 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)
{
2024-05-29 16:29:13 +02:00
(ItemsControl.ItemsControlFromItemContainer(this) as MapItemsControl)?
.OnItemClicked(this, e.KeyModifiers.HasFlag(KeyModifiers.Control));
2024-05-28 08:09:44 +02:00
e.Handled = true;
2024-05-27 16:35:02 +02:00
}
2024-05-30 22:08:51 +02:00
protected override void OnPointerReleased(PointerReleasedEventArgs e)
{
}
2024-05-27 16:35:02 +02:00
}
}