We've observed a change in behavior with WPF drag/drop after upgrading to 17.2 from 16.1.
There used to be an easy way to create a DragSnapshotElement from scratch, and assign it to the Drag/Drop manager for display while dragging.
However, now in 17.2 the element is not appearing anymore. I'm not sure if this is expected behavior or not. I've seen conflicting statements about whether the element that is used in the DragSnapshotElement needs to already be present in the visual tree.
Here is an example where the element assigned to DragSnapshotElement was NOT already in the visual tree:
https://es.infragistics.com/help/wpf/drag-and-drop-framework-ig-drag-and-drop-framework-events
That is basically the scenario we were using, and it no longer works. We are on 17.2 service release 2188.
Attached is a full example. If you try to drag the "Drag Me" textblock over the target, you will not see the snapshot while dragging.
You can edit the section labeled "CHANGE THIS CONDITION" to switch the snapshot to something that is in the visual tree, and that seems to work.
WpfDragStartTesting.zip
Any pointers would be appreciated. I had seen some notes in the volume releases about "Drag and Drop Framework Bug Fix" but none of them implied that the snapshot behavior would change.
Thanks, David
You are very welcome sir! I just created a development item for the team to prioritize accordingly and investigate. The key for the development item is 259684.
At this time I will transition this forum to a private support case, which is already created, where we can continue our discussion. You will find the case in the development tab marked CAS-199300-P9K2P5.
Let me know if you have any questions.
Thank you very, very much! It is always a good feeling to successfully transfer a repro. Infragistics has high-quality support - but you would be amazed at how hard it is for some third-party vendors to confirm a problem exists on their end.
Like I had said earlier, I've seen conflicting statements about whether the element that is used in the DragSnapshotElement needs to already be present in the visual tree or not. I think that was a requirement for Silverlight (may it rest in peace) but my understanding was that WPF should be able to drag a snapshot that was created for that purpose and wasn't part of the visual tree. This worked in the past. And certainly the docs seem to say that this is supposed to work too: https://es.infragistics.com/help/wpf/drag-and-drop-framework-ig-drag-and-drop-framework-events
Hello David,
I now reproduced what you expected in 16.1. See images below. I will be reporting this with our development team in this afternoon. Let me know if you need any additional help.
17.2:
16.1:
The difference was between volume 2016.1 and 2017.2. You are supposed to be seeing a Drag Snapshot Image (along with the change in the mouse icon). That is supposed to happen when the code is written as-is.
If you want to see what a drag snapshot image looks like, you can edit the section labeled "CHANGE THIS CONDITION" to switch the snapshot to something that is in the visual tree, and that seems to work. You simply change the condition (comparison against null) and it will start showing a drag snapshot.
I've discovered that the difference in behavior seems to be related to whether the thing that is dragged was already in the visual tree or not. However, as I mentioned earlier, the code as-written is already supposed to be working without modification, and it does for me in 2016.1. And the docs say it is supposed to work too: https://es.infragistics.com/help/wpf/drag-and-drop-framework-ig-drag-and-drop-framework-events
(I'm not sure why you mentioned a comparison between 1000 and 2188 ... I'm assuming those two are service releases of volume 2017.2? I would guess that this broke/changed between volume 2016.1 and the first release of volume 2017.2)
I tested both 1000 and 2188 and I see the same behavior. Please see the following screenshots taken from 2188. Keep in mind the icon does change, in both versions, from a "X" to a "Hand" when pressing down on the left click between "Drag Me" to "Target". The Red will also turn back white/red depending on whether or not the mouse left the "Target" in both versions.
If there is a specific event not firing, I'm not seeing it. If the behavior matches up but there is some additional step I missed please list your exact steps.