2025-02-27 18:46:32 +01:00
|
|
|
|
namespace MapControl
|
2024-05-27 16:35:02 +02:00
|
|
|
|
{
|
|
|
|
|
|
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));
|
|
|
|
|
|
|
2025-03-12 19:45:08 +01:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Replaces ListBoxItem pointer event handling by not calling base.OnPointerPressed.
|
|
|
|
|
|
/// Setting e.Handled = true generates a PointerReleased event in the parent MapItemsControl,
|
|
|
|
|
|
/// which resembles the behavior of the ListBox base class.
|
|
|
|
|
|
/// </summary>
|
2024-05-27 16:35:02 +02:00
|
|
|
|
protected override void OnPointerPressed(PointerPressedEventArgs e)
|
|
|
|
|
|
{
|
2025-03-12 19:45:08 +01:00
|
|
|
|
if (!e.Handled)
|
|
|
|
|
|
{
|
|
|
|
|
|
e.Handled = true;
|
|
|
|
|
|
(ItemsControl.ItemsControlFromItemContainer(this) as MapItemsControl)?
|
|
|
|
|
|
.OnItemClicked(this, e.KeyModifiers.HasFlag(KeyModifiers.Control));
|
|
|
|
|
|
}
|
2024-05-27 16:35:02 +02:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|