tags:

views:

86

answers:

1

I'm working on a project right now in which I need to automate animated scrolling for DataTemplates displayed in ListBoxes throughout the application. Basically something common in Javascript like this Javascript smooth scrolling example that runs on a timer.

I've seen a few other people around posting similar questions like this one but I haven't really seen anyone gracefully implement it. I have tried overriding the LineDownCommand in the ScrollViewer, but that's not really what I'm trying to accomplish (nor is it CanContentScroll="False"). I am already using BringIntoView temporarily until this is implemented, but that doesn't do exactly what I need.

Has anyone else had any luck implementing this or have any pointers in the right direction? I'm on a pretty short timeline here.

Thanks!

A: 

Really what you need to do is implement your own ScrollViewer which derives from ContentControl. By doing that you can take complete control over all the scrolling and implement your own special commands to initiate automated smooth scrolling. If you run into trouble implementing it, you can always use the WPF templates and Reflector to see how Microsoft did it.

Daniel Moore
I was hoping to do it just using the ListBox, but this is the method I had to end up using. Basically had to go with an animation running on the canvas since clipping was giving me problems when animating the ListBox and ScrollViewer themselves.
Jeff Wain