0
我试图做故事板动画,但我无法更改ScrollViewer的VerticalOffset属性。此代码与Opacity等效果很好。属性,但不与VerticalOffset和HorizontalOffset一起使用。如何设置Storyboard Animation(Windows通用应用程序)的ScrollViewer VerticalOffset属性?
private void MakeVerticalAnimation()
{
Storyboard AnimationStoryboard = new Storyboard();
DoubleAnimation VerticalOffsetAnimation = new DoubleAnimation();
Storyboard.SetTarget(VerticalOffsetAnimation, MyScrollViewer);
Storyboard.SetTargetProperty(VerticalOffsetAnimation, "VerticalOffset");
VerticalOffsetAnimation.EnableDependentAnimation = true;
VerticalOffsetAnimation.From = 100;
VerticalOffsetAnimation.To = 0;
VerticalOffsetAnimation.Duration = TimeSpan.FromSeconds(3);
AnimationStoryboard.Children.Add(VerticalOffsetAnimation);
AnimationStoryboard.Begin();
}
哦...傻了。任何方式来编辑ScrollViewer模板来调整滚动速度。目前速度对于我的目的来说太快了。看起来像我需要为我的问题找到其他解决方案。 – Weissu