Hello, In my project i have two xamTilesControls, I'm trying to enable dragging a tile from of them to the other, but when the dragged tile exits its own XamTilesControl, the icon changes to a "don't allow" kind of icon and i cant complete the action.
I tried catching the DragEnter, and Drop events on the other control, but they are not called (actually, they are not called on any other control).
If I perform a "e.Cancel = true" on the TileDragging event of the source control, and then perform a regular "DragDrop.DoDragDrop" with my own custom data- I can get it to work, but then (of-course) the tile swapping and animation within the same XamTilesControl doesn't work.
Can this be done? it's crucial for our application.
Thanks!
The only way to do it currently is to take over the drag operation entirely which has the downsides you describe.
This capability sounds like something we should add to the control but I realize that doesn't help you now.
OK thanks, I hope you do that sometime :)
For now- how would you recommend implementing the tile swapping and reordering myself? I thought about using a DragAdorner to add the little thumbnail of the dragged tile - but i'm not sure about how to implement the swap\moving animations when dropping the tile.. Maybe there is some way to simulate to the control a Tile drop operation like it expects (raise some drop event with the right parameters?)- or do your implementation do the whole thing- coordinates and state and so on..
Thanks.
An adorner or popup would work for the drag indicator.
To process the drop you should be able to just remove the item from one collection and add it to the other. For state information you can call the XamTileControl's GetItemInfo method which will return an object that exposes 3 read/write properties, IsClosed, IsExpandedWhenMinimized and IsMaximized.
As far as the animations after a drop are concerned most of them should happen automatically.