var delta = eventArgs.WheelDelta;
delta *= scrollAmount;
var newOffset = childScrollViewer.VerticalOffset - delta;
if (newOffset > childScrollViewer.ScrollableHeight)
newOffset = childScrollViewer.ScrollableHeight;
else if (newOffset < 0)
newOffset = 0;
childScrollViewer.ScrollToVerticalOffset(newOffset);
|