(VB.NET + WPF) Drag + Drop (to allow user sorting) of stackpanel elements within a Scrollviewer?
- by Matt H.
I have good model (I think!) for how to allow a user to drag an element in a stackpanel and reposition it to another location within the stackpanel.
However, my Stackpanel is placed within a ScrollViewer, like this (generalized):
<ScrollViewer>
<StackPanel>
....First item
....Second item
....Third item
....Etc.
</StackPanel>
<ScrollViewer>
Here is the problem, I wish to simulate the functionality of programs like word, where if I am dragging selected content (or an object) outside the viewable area, the window will scroll in the direction of the mouse to see more places to drop my nifty little object.
...i.e. If I move the mouse to the top of my ScrollViewer while dragging a stackpanel's contents, I want the scrollviewer to slowly move up so I can see more locations to drop my content.
Any suggestions?
If you can help me solve this, you will be a godsend!