Reputation: 8932
I want to create VariableSizedWrapGrid like this
BUT, I also want the items to be draggable (the CanReorderItems property), according to this post this is not supported because the lack of 'some' interfaces.. I tried it and indeed the reordering stops working if I use the VariableSizedWrapGrid.
Could anybody point me in the right direction of the interfaces that are missing to get this done?
Upvotes: 3
Views: 1508
Reputation: 1117
Flores,
You pretty much have to implement the drag events yourself.
Here's an excellent blog post detailing what you need to do:
http://www.renauddumont.be/en/2012/windows-8-csharp-xaml-drag-drop
However, the blog doesn't mention how to do the DragOver logic very well. Basically, you have to check what item you're over, and then depending on the direction (dragging up/down/left/right) you have to call the corresponding visual state to get the smooth animation.
So for example, if the dragged item was over an item below it (you can check based on the item's index in your collection), then you need to do something like:
VisualStateManager.GoToState((Control)containerOfItemBelow, "BottomReorderHint", true);
BTW, if you're using a GroupedDataSource, Drag & Drop would also be broken. I found that I can skirt the whole GroupedDataSource concept easily by nesting Gridviews & Listsviews.
HTH
Upvotes: 1