2014-04-22 5 views
0

애니메이션이 있습니다.
그러나 나는 그것을 막을 수 없다.
스토리 보드 반복 동작 속성이 "영원히"이기 때문에.
코드 숨김에서 애니메이션을 중단하려면 어떻게해야합니까?WPF에서 스토리 보드를 중지하는 방법?

다음
<UserControl.Resources> 
    <Storyboard x:Name="loadingAnimation" x:Key="LoadingAnimation" RepeatBehavior="Forever" SpeedRatio="1" AutoReverse="True"> 
     <DoubleAnimationUsingKeyFrames x:Name="doubleAnimationUsingKeyFrames" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="pathListBox"> 
      <EasingDoubleKeyFrame KeyTime="0" Value="0"/> 
      <EasingDoubleKeyFrame KeyTime="0:0:1" Value="1"/> 
     </DoubleAnimationUsingKeyFrames> 
     <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" Storyboard.TargetName="ellipse"> 
      <EasingDoubleKeyFrame KeyTime="0:0:1" Value="293.73"> 
       <EasingDoubleKeyFrame.EasingFunction> 
        <BackEase EasingMode="EaseOut"/> 
       </EasingDoubleKeyFrame.EasingFunction> 
      </EasingDoubleKeyFrame> 
      <EasingDoubleKeyFrame KeyTime="0:0:2" Value="560.097"/> 
     </DoubleAnimationUsingKeyFrames> 
    </Storyboard> 
</UserControl.Resources> 
+1

(http://stackoverflow.com/questions/5623601/stop 여기

내 XAML입니다 -wpf-animation-storyboard-begin-in-xaml-but-stop-in-codebehind)를 사용합니다. 그것을 밖으로 씹어, 그것은 당신을 위해 너무 일할 수 있습니다. – icebat

+0

고마워요. 지금이 코드를 쓰고 있습니다. – MLElyakan

+0

@MLE가 귀하의 질문에 대한 답변 이었습니까? – csharpwinphonexaml

답변

0

은 당신이 할 수있는 방법은 다음과 같습니다 :

이미 유사한 [질문]이 있었다
Storyboard storyboard = (Storyboard)Resources["LoadingAnimation"]; 
storyboard.Stop(); 
관련 문제