How to stop an animation in C# / WPF?

前端 未结 8 693
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-11-28 08:54

I have something like this:

barProgress.BeginAnimation(RangeBase.ValueProperty, new DoubleAnimation(
    barProgress.Value, dNextProgressValue,
    new Duration(T         


        
相关标签:
8条回答
  • 2020-11-28 09:52
    <Trigger.EnterActions>
           <BeginStoryboard x:Name="myStory">
           .........
           </BeginStoryboard>
    </Trigger.EnterActions>
    <Trigger.ExitActions>
           <StopStoryboard BeginStoryboardName="myStory"/>
    </Trigger.ExitActions>
    
    0 讨论(0)
  • 2020-11-28 09:57

    To stop it, call BeginAnimation again with the second argument set to null.

    0 讨论(0)
提交回复
热议问题