pavan kumar
pavan kumar

Reputation: 93

Restrict dragged items within the stack panel in uwp?

I am implemented stack panel children to reorder using drag and drop in uwp, but I don't want stack panel child to go out of stack panel while dragging, so how can I achieve this?

Upvotes: 0

Views: 74

Answers (1)

Nico Zhu
Nico Zhu

Reputation: 32785

I have to say, drag and drop api can't implement such feature for stackpanel, we suggest your use list view to replace that contains CanReorderItems propety. you could set it as true to drag item to you want index.

<ListView CanDragItems="True" CanReorderItems="True" AllowDrop="True"
SelectionMode="Single" />

Upvotes: 2

Related Questions