Update MapItem.WinUI.cs

This commit is contained in:
ClemensFischer 2025-03-12 19:23:05 +01:00
parent 2eba063f37
commit 417d4c8987

View file

@ -35,8 +35,19 @@ namespace MapControl
protected override void OnPointerPressed(PointerRoutedEventArgs e)
{
(ItemsControl.ItemsControlFromItemContainer(this) as MapItemsControl)?
.OnItemClicked(this, e.KeyModifiers.HasFlag(VirtualKeyModifiers.Control));
// Prevent default handling in ListBoxItem by not calling base.OnPointerPressed.
if (!e.Handled)
{
e.Handled = true;
(ItemsControl.ItemsControlFromItemContainer(this) as MapItemsControl)?
.OnItemClicked(this, e.KeyModifiers.HasFlag(VirtualKeyModifiers.Control));
}
}
protected override void OnPointerReleased(PointerRoutedEventArgs e)
{
// Prevent default handling in ListBoxItem by not calling base.OnPointerReleased.
e.Handled = true;
}
protected override void OnApplyTemplate()