If you have used the scrollviewer control then one thing that you might have noticed is that the viewer doesnt scroll if we drag some data towards the boundary of the control. It would be nice if we could get the viewer to scroll on mouse drag. Try the following Xaml code – type in several lines of text so that the viewer scrolls. Now drag some text to the boundary – oops!! no scrolling ..
<TextBox AcceptsReturn=’True’ VerticalScrollBarVisibility=’Visible’>text</TextBox>
Dont sweat it :), Dan Crevier came up with some code which addresses the above. The code extends the scrollviewer to handle the up/down scrolling on dragging to the upper/lower boundaries of the scrollviewer. The code is attached to this post and will also be posted on the WPF community site. 🙂