我有一个名为tbMaster
:
<Slider Name="tbMaster" Maximum="10000" Value="{Binding SbVolumeValue}"/>
绑定属性的代码:
double _SbVolumeValue;
public double SbVolumeValue
{
get
{
return _SbVolumeValue;
}
set
{
_SbVolumeValue = value;
OnPropertyChanged("SbVolumeValue");
}
}
我有故事板sbVolume
<Storyboard x:Key="sbVolume">
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(RangeBase.Value)" Storyboard.TargetName="tbMaster">
<EasingDoubleKeyFrame KeyTime="0:0:1.2" Value="40">
<EasingDoubleKeyFrame.EasingFunction>
<CircleEase EasingMode="EaseOut"/>
</EasingDoubleKeyFrame.EasingFunction>
</EasingDoubleKeyFrame>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
如果我运行应用程序,滑块效果很好。当我开始故事板时它停止工作:
var sbVolume = this.FindResource("sbVolume") as Storyboard;
sbVolume.Begin();
为什么我制作动画后它停止工作?