Lgn
Lgn

Reputation: 10119

Free drag and drop in Windows 8 Metro Apps?

Can I drag an item (image, rectangle or other shapes ...) and drop it freely somewhere on the screen? I know there is a way to drag and drop items from a GridView to another, but I would like to do it without restrictions (and without Directx). And I also found only a quickguide for drag&drop, no useful examples, that's why I'm curious.

Upvotes: 2

Views: 1150

Answers (1)

Kevin Cloet
Kevin Cloet

Reputation: 2976

I had the same problem. After trying to work with Manipulation etc I just gave up and implemented a quick work around.

I just placed my item ( Circle in my case ) into a ListView and allowed the ListViewItems to be dragged. (CanDragItems). I also removed all the styles so it wouldn't look like a ListView.

This way I could drag my ListViewItem (which was just a circle) and drop it somewhere. You don't have to drop it into another ListView.

If you put these property

Drop="imgCart_Drop_1" AllowDrop="True"

on an image for example then you can capture the drop event.

I hope this helps

Upvotes: 1

Related Questions