private void IcdList_ScrollHint(object sender, IcdListScrollHintEventArgs e) { //When a child list sends a scroll hint, propogate this up, with an adjusted hint value var icdlist = sender as IcdList; if (icdlist != null) { var position = icdlist.TranslatePoint(new Point(0, 0), this); if (ScrollHint != null) { ScrollHint(this, new IcdListScrollHintEventArgs(position.Y + e.Hint)); } } }
void IcdList_ScrollHint(object sender, IcdListScrollHintEventArgs e) { var animate = new DoubleAnimation(); animate.From = scrollViewer.VerticalOffset; animate.To = e.Hint; animate.DecelerationRatio = 0.2; animate.Duration = new Duration(TimeSpan.FromMilliseconds(300)); var story = new Storyboard(); story.Children.Add(animate); Storyboard.SetTarget(animate, scrollViewer); Storyboard.SetTargetProperty(animate, new PropertyPath(Behaviors.ScrollViewerBehavior.VerticalOffsetProperty)); story.Begin(); }