private static void OnHorizontalScrollOffsetChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { AnimatedScrollViewer thisSViewer = (AnimatedScrollViewer)d; thisSViewer.ScrollToHorizontalOffset((double)e.NewValue); }