From 2eba063f37944fe376378b89932941982e6f5f49 Mon Sep 17 00:00:00 2001 From: ClemensFischer Date: Wed, 12 Mar 2025 17:53:56 +0100 Subject: [PATCH] Update MapItem.WPF.cs --- MapControl/WPF/MapItem.WPF.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/MapControl/WPF/MapItem.WPF.cs b/MapControl/WPF/MapItem.WPF.cs index 935e6be9..c410ed77 100644 --- a/MapControl/WPF/MapItem.WPF.cs +++ b/MapControl/WPF/MapItem.WPF.cs @@ -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; } } }