When I make a Drag for an element and if I move it to a place where it cannot be DragLeave , the DragLeave event is DragLeave , as if the repacking is complete. But as a matter of fact, without releasing the button, I can still pull the element and put it in another place. In general, I need to somehow find out what exactly the user completed the drop or canceled it. How can this be implemented?

  • Leave means that the area is abandoned, and the window should not "accompany" the object, because it will be followed by another window. In order to determine whether an object is placed or not, you still need to read the additional parameters of this function / handler. - nick_n_a

1 answer 1

Solved a problem. If AllowedEfects DragDropEffects.None comes in additional parameters, then the user has stopped dragging.

 private void AssociatedObject_PreviewDragLeave(object sender, DragEventArgs e) { if (e.AllowedEffects == DragDropEffects.None) { // } }