【发布时间】:2014-04-10 18:24:34
【问题描述】:
我正在使用 StoryBoard 为 ListBox 的 SelectedIndex 设置动画。
<Storyboard x:Key="FlipBook" RepeatBehavior="Forever">
<Int32AnimationUsingKeyFrames Storyboard.TargetProperty="(Selector.SelectedIndex)" Storyboard.TargetName="FlipBookView">
<EasingInt32KeyFrame KeyTime="0" Value="0"/>
<EasingInt32KeyFrame KeyTime="0:0:1" Value="1"/>
<EasingInt32KeyFrame KeyTime="0:0:2" Value="0"/>
</Int32AnimationUsingKeyFrames>
</Storyboard>
当 SelectedIndex 发生变化时,我希望 ListBox 自动(并立即)滚动到该项目。
我相信 ListBox.ScrollIntoView 会做我想要的,但我需要它在 SelectedIndex 更改时自动触发。
这可能吗?
【问题讨论】: