diff --git a/src/Avalonia.Xaml.Interactions.DragAndDrop/ContextDragBehavior.cs b/src/Avalonia.Xaml.Interactions.DragAndDrop/ContextDragBehavior.cs index 895dc00f..0874bacb 100644 --- a/src/Avalonia.Xaml.Interactions.DragAndDrop/ContextDragBehavior.cs +++ b/src/Avalonia.Xaml.Interactions.DragAndDrop/ContextDragBehavior.cs @@ -3,6 +3,7 @@ using Avalonia.Controls; using Avalonia.Input; using Avalonia.Interactivity; +using Avalonia.LogicalTree; using Avalonia.Xaml.Interactivity; namespace Avalonia.Xaml.Interactions.DragAndDrop; @@ -136,6 +137,7 @@ private void AssociatedObject_PointerPressed(object? sender, PointerPressedEvent if (e.Source is Control control && AssociatedObject?.DataContext == control.DataContext) { + if ((control as ISelectable ?? control.Parent as ISelectable ?? control.FindLogicalAncestorOfType())?.IsSelected ?? false) e.Handled = true; //avoid deselection on drag _dragStartPoint = e.GetPosition(null); _triggerEvent = e; _lock = true;