0

I want to animate vertical scrolling of ScrollViewer. As I understand it the only way to get this event

private void viewer_ScrollChanged (object sender, ScrollChangedEventArgs e)

And within a handler to start the animation. But in this case, the handler will be called at each step of the animation. How do I distinguish the animation process from such PageUp?

Maybe there is some better way to override the changes in the vertical offset?

Mixer
  • 1,292
  • 3
  • 22
  • 41
  • Perhaps duplicate question?: http://stackoverflow.com/questions/665719/wpf-animate-listbox-scrollviewer-horizontaloffset – Ed Ayers Jan 04 '14 at 14:31

2 Answers2

1

Unfortunately, you'd probably have to create a custom control for that.

Fortunately, it has been done here. I've tried it (long time ago) and it works. Oh, I see that there is/are ready-made DLL to download from the page, so you don't have to create it from scratch.

XAMeLi
  • 6,189
  • 2
  • 22
  • 29
0

Not entirely clear on what you're trying to do - but I'm guessing that you only want to animate when the user moves the scroll bar with the mouse - so how about handling MouseDown on ScrollViewer (record what the position is) and handle MouseUp, if there was scroll do your animation?

I think using mouseup/down in this case is fine as you don't want the animation for general scrolling?

Jim W
  • 4,866
  • 1
  • 27
  • 43
  • Everything is as you describe. But I would like to animate all possible situations. (Mouse Wheel, Home, End etc) And not to calculating the required offset. Ie just animate all type of offsets. – Mixer Apr 09 '13 at 16:03