Update MapItem.WPF.cs

This commit is contained in:
ClemensFischer 2025-03-12 17:53:56 +01:00
parent fde1919356
commit 2eba063f37

View file

@ -21,14 +21,18 @@ namespace MapControl
protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e)
{
// Prevent default handling in ListBoxItem by not calling base.OnMouseLeftButtonDown.
(ItemsControl.ItemsControlFromItemContainer(this) as MapItemsControl)?
.OnItemClicked(this, Keyboard.Modifiers.HasFlag(ModifierKeys.Control));
if (!e.Handled)
{
e.Handled = true;
(ItemsControl.ItemsControlFromItemContainer(this) as MapItemsControl)?
.OnItemClicked(this, Keyboard.Modifiers.HasFlag(ModifierKeys.Control));
}
}
protected override void OnMouseRightButtonDown(MouseButtonEventArgs e)
{
// Prevent default handling in ListBoxItem by not calling base.OnMouseRightButtonDown.
e.Handled = true;
}
}
}