Windows Phone ItemsControl drag and drop items

25 views Asked by At

How to do drag and drop with elements in ItemsControl? I turn AllowDrop and CanDrag in true but nothing works.

<ItemsControl Visibility="Collapsed"  ItemsSource="{Binding MyItems}" Margin="0,3,0,0"  Padding="5,0,0,0" CanDrag="True" AllowDrop="True">
                <ItemsControl.ItemsPanel>
                    <ItemsPanelTemplate>
                        <ItemsWrapGrid MaximumRowsOrColumns="3" Orientation="Horizontal"/>
                    </ItemsPanelTemplate>
                </ItemsControl.ItemsPanel>
                <ItemsControl.ItemTemplate>
                    <DataTemplate>
                        <Border CanDrag="True" AllowDrop="True" Background="{Binding Color}" Height="{Binding Height}" Width="{Binding Width}"/>
                    </DataTemplate>
                </ItemsControl.ItemTemplate>
            </ItemsControl>

This does not work on the phone. I know about listView and GridView. I do not need Reorder Mode. I need a table where you can drag and drop items, and replace each other. 1 > 5 and 5 > 1 places. Swap elements of the first to the fifth, and the fifth on the first!

I have thought of doing something like CanvasTabelView. I do not know whether it is real!

0

There are 0 answers