Reputation: 1025
Same question here. Below is part of my ListView
. I am able to drag and drop but the events (e.g., DropCompleted, Drop, DragItemsCompleted, ManipulationCompleted) are not triggered. Any ideas?
<ListView
x:Name="SongsListView"
Grid.Row="1"
AllowDrop="True"
CanDrag="True"
CanReorderItems="True"
ContainerContentChanging="SongsListView_ContainerContentChanging"
IsItemClickEnabled="True"
ItemClick="SongsListView_ItemClick"
ItemsSource="{Binding Songs, Mode=TwoWay}"
ReorderMode="Enabled"
SelectionMode="None">
</ListView>
Upvotes: 0
Views: 594
Reputation: 5868
About the DragItemsCompleted.
It occurs when a drag operation that involves one of the items in the ListView is ended. So in order to receive this event, you need to set the CanDragItems property to True.
About Drag and Drop event.
You need to have another control that can receive the placed content (e.g. the placed content is ListViewItem). The control needs to set the AllowDrop property to true to enable placement and subscribes DragOver and Drop event. In this case, when you drag the item, the DragOver event which the control suscribes will be triggered and when you drop the item to the control, the Drop event will be triggered. For more details about Drag and Drop, you can refer to this document;
Upvotes: 1