简体   繁体   中英

Silverlight drag n drop element hides when outside of ListBox

I implemented a drag and drop of an image from a Grid to another Grid using built-in MouseDragElementBehavior class. Then I needed to use a bit more complex layout for the source items so used ListBox and ItemTemplate instead.

The problem is now when dragging an item from the ListBox it is only visible when above the ListBox. How do I make it always visible and following mouse cursor anywhere while being dragged?

I suggest that instead of writing your own implementation using the Blend SDK, that you use the Silverlight Toolkit ListBoxDragDropTarget control.

The reason the item disappears in your element is that the MouseDragElementBehaviour is simplistically applying a render transform to affect the movement. However the ListView places its item panel inside a ScrollViewer which clips its content to its viewport.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM