4

I need to change position of items in WrapPanel (or stack-panel with horizontal orientation) using dragging when user touches with it.

I tried MouseDragElementBehavior, but it changes position for current item only and do not for others.

I saw this article but it working with listBox with vertical orientation. So does exist any ways for this?

Roman Golenok
  • 1,427
  • 9
  • 26

1 Answers1

0

A WrapPanel is not the perfect panel for Drag&Drop because it does not have the notion of order. In fact, items are ordered based upon the order in the datasource.

With your example , you can simply change change the ItemsPanel like this :

 <rlb:ReorderListBox

          ...
            <rlb:ReorderListBox.ItemsPanel>
                <ItemsPanelTemplate>
                    <toolkit:WrapPanel ItemWidth="100" ItemHeight="50"/>
                </ItemsPanelTemplate>
            </rlb:ReorderListBox.ItemsPanel>
...
Cybermaxs
  • 24,378
  • 8
  • 83
  • 112