Timeline.Duration 속성

정의

반복을 제외하고 이 Timeline이 재생되는 시간을 가져오거나 설정합니다.

public:
 property System::Windows::Duration Duration { System::Windows::Duration get(); void set(System::Windows::Duration value); };
public System.Windows.Duration Duration { get; set; }
member this.Duration : System.Windows.Duration with get, set
Public Property Duration As Duration

속성 값

Duration

Timeline이 단일 정방향 반복을 완료하는 데 걸리는 시간인 Timeline의 단순 지속 시간입니다. 기본값은 Automatic입니다.

예제

ParallelTimeline개체의 TimelineGroup 형식입니다Storyboard. 기간 TimelineGroup 은 자식 타임라인의 기간에 따라 결정됩니다. 예를 들어 Storyboard 마지막 자식 타임라인()이 종료될 때이므로 아래는 6초(DoubleAnimation6초의 기간)동안 실행됩니다.

참고

참고: 다음 예제에서는 코드가 생략되었습니다. 이 예제는 설명용으로만 제공됩니다.

[xaml]

...  
  <Storyboard>  
    <DoubleAnimation Duration="0:0:2" …/>  
    <DoubleAnimation Duration="0:0:4" BeginTime="0:0:2" …/>  
  </Storyboard>   
...  

애니메이션의 <Type>예로는 ,PointAnimation, ColorAnimation등이 있습니다DoubleAnimation. 이러한 유형의 애니메이션에 대해 지정되지 Duration 않은 경우 1초 동안 실행됩니다.

[xaml]

...  
  <!-- With no Duration specified, this animation will run for   
       one second -->  
  <DoubleAnimation .../>  
...  

AnimationUsingKeyFrames의 <Type>예는 DoubleAnimationUsingKeyFramesPointAnimationUsingKeyFrames입니다. 이러한 유형의 애니메이션에 대해 지정되지 않은 Duration 경우 모든 키 프레임이 완료될 때까지 실행됩니다.

[xaml]

...  
  <Storyboard>  

    <!-- This key frame animation will end at 4.5 seconds  
         Because that is when its last KeyFrame KeyTime ends. -->  
    <DoubleAnimationUsingKeyFrames ...>  
      <LinearDoubleKeyFrame ... KeyTime="0:0:3" />  
      <DiscreteDoubleKeyFrame ... KeyTime="0:0:3.5" />  
      <DiscreteDoubleKeyFrame ... KeyTime="0:0:4" />  
      <DiscreteDoubleKeyFrame ... KeyTime="0:0:4.5" />  
    </DoubleAnimationUsingKeyFrames>  
  </Storyboard>   
...  

설명

타임라인의 간단한 기간은 반복을 포함하는 총 재생 시간과 단일 정방향 반복에 대한 시간을 구성합니다.

기본 기간 동작

값이 있는 Duration 구조체의 Automatic 동작은 타임라인 유형에 따라 달라집니다.

타임라인 동작
Timeline 미정(Timeline 추상)
ParallelTimeline,

Storyboard,

TimelineGroup
자식 타임라인에 맞게 확장
<Type>애니메이션("From/To/By" 또는 "basic" 애니메이션이라고 함) 1초
<Type>AnimationUsingKeyFrames(키 프레임 애니메이션이라고 함) 모든 키 프레임 KeyTime 값의 합계

종속성 속성 정보

식별자 필드 DurationProperty
메타 데이터 속성 설정 true 없음

적용 대상

추가 정보