Question

How i can re-arrange images inside a stackpanel / Grid, using drag and drop, In my sample app i have 4 images. I need to re arrange these images through drag and drop. I found a solution for doing the same inside listbox. But i can't use that in my application. I am new to the technology so someone please help me to implement the same.

Was it helpful?

Solution 2

You can use the code used in my question for implementing the same. It will works fine for me. Please check the code and let me know if any issues.

Answer Link

OTHER TIPS

This can be really tricky. The right implementation would involve intensive usage of advanced Drag and Drop techniques, such as adorners, hit testing, marking the position for the dragged item as you dragging it over etc. I'd stay away from this complexity at least until you get more versed with WPF itself.

If the sample you found does exactly what you need - it's a straightforward task to convert listbox to stackpanel. If your items are positioned in a more complex way (for example using inline-block positioning), then you're back to square one. Could you post some screenshots for what you're trying to achieve?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top