Timeline.BeginTime Timeline.BeginTime Timeline.BeginTime Timeline.BeginTime Property

定義

この Timeline を開始する時間を取得または設定します。Gets or sets the time at which this Timeline should begin.

public:
 property Nullable<TimeSpan> BeginTime { Nullable<TimeSpan> get(); void set(Nullable<TimeSpan> value); };
public Nullable<TimeSpan> BeginTime { get; set; }
member this.BeginTime : Nullable<TimeSpan> with get, set
Public Property BeginTime As Nullable(Of TimeSpan)

プロパティ値

この Timeline を開始する時間 (親の BeginTime に対する相対的な時間)。The time at which this Timeline should begin, relative to its parent's BeginTime. このタイムラインがルート タイムラインの場合は、対話による開始時間 (タイムラインがトリガーされた時間) に対する相対的な時間になります。If this timeline is a root timeline, the time is relative to its interactive begin time (the moment at which the timeline was triggered). この値には、正の値、負の値、または null を指定できます。値が null の場合、そのタイムラインは再生されません。This value may be positive, negative, or null; a null value means the timeline never plays. 既定値は 0 です。The default value is zero.

タイムラインのBeginTimeプロパティは、タイムラインのアクティブな期間の開始を決定します。A timeline's BeginTime property determines the beginning of a timeline's active period. タイムラインに、親タイムライン、BeginTimeプロパティがその親の開始後に開始するためにタイムラインにかかる時間を決定します。If the timeline has a parent timeline, the BeginTime property determines how long it takes the timeline to start after its parent starts. タイムラインがルート タイムラインの場合 (、Storyboardなど)、BeginTimeプロパティは、タイムラインでは、トリガーされた後に再生を開始にかかる時間を決定します。If the timeline is a root timeline (a Storyboard, for example), the BeginTime property determines how long the timeline takes to start playing after it is triggered.

次の例では、異なる複数の異なるタイムラインBeginTime設定します。The following example shows several different timelines with different BeginTime settings.

<!-- This example shows how the BeginTime property determines when a timeline starts.
     Several rectangles are animated by DoubleAnimations with identical 
     durations and target values, but with different
     BeginTime settings. -->
     
<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  WindowTitle="BeginTime Example">
  <StackPanel Margin="20">

    <!-- The rectangles to animate. -->
    <Rectangle Name="DefaultBeginTimeRectangle" 
      Width="20" Height="20" Fill="Blue"  />
      
    <Rectangle Name="DelayedBeginTimeRectangle" 
      Width="20" Height="20" Fill="Blue"  />
    
    <Rectangle Name="DelayedAnimationWithDelayedParentRectangle" 
      Width="20" Height="20" Fill="Blue"  /> 

    <Rectangle Name="NegativeBeginTimeExampleRectangle" 
      Width="20" Height="20" Fill="Blue"  />            
    
    <!-- Create a button to start the animations. -->
    <Button Margin="20" Content="Start Animations">
      <Button.Triggers>
        <EventTrigger RoutedEvent="Button.Click">
          <BeginStoryboard>
            <Storyboard>

              <!-- This animation starts as soon as the button is clicked, because it
                   has a BeginTime of 0. -->
              <DoubleAnimation 
                Storyboard.TargetName="DefaultBeginTimeRectangle" 
                Storyboard.TargetProperty="Width"
                BeginTime="0:0:0" From="100" To="600" Duration="0:0:5"  /> 

              <!-- This animation starts 5 seconds after the button is clicked. -->
              <DoubleAnimation 
                Storyboard.TargetName="DelayedBeginTimeRectangle" 
                Storyboard.TargetProperty="Width"  
                BeginTime="0:0:5" From="100" To="600" Duration="0:0:5" />
                
              <ParallelTimeline BeginTime="0:0:5">  

              <!-- This animation starts 10 seconds after the button is clicked, 
                   because its parent has a BeginTime of 5 seconds and it has
                   a BeginTime of 5 seconds: 5 + 5 = 10.  -->              
                <DoubleAnimation  
                  Storyboard.TargetName="DelayedAnimationWithDelayedParentRectangle" 
                  Storyboard.TargetProperty="Width" 
                  BeginTime="0:0:5" From="100" To="600" Duration="0:0:5"  />
              </ParallelTimeline>
              
              <!-- This animation starts as soon as the button is clicked, but
                   it animates from 350 to 600 instead of from 100 to 600 
                   because of its negative BeginTime. The negative BeginTime
                   setting advances the animation, so that it behaves as though
                   it had already been playing for 2.5 seconds as soon as it is
                   started. -->
              <DoubleAnimation 
                Storyboard.TargetName="NegativeBeginTimeExampleRectangle" 
                Storyboard.TargetProperty="Width"  
                BeginTime="-0:0:2.5" From="100" To="600" Duration="0:0:5" />              
              
            </Storyboard>
          </BeginStoryboard>
        </EventTrigger>
      </Button.Triggers>      
    </Button>
    
    <!-- This example demonstrates how the BeginTime property works on a root timeline. -->
    <Rectangle Name="RootTimelineWithDelayedBeginTimeRectangle"
      Width="20" Height="20" Fill="Blue" >
      <Rectangle.Triggers>
        <EventTrigger RoutedEvent="Rectangle.MouseLeftButtonDown">
          <BeginStoryboard>
            <Storyboard BeginTime="0:0:5">
            
              <!-- This animation starts 5 seconds after the left mouse button
                   is pressed, because its parent storyboard (a root timeline)
                   has a BeginTime of 5 seconds. -->
              <DoubleAnimation 
                Storyboard.TargetName="RootTimelineWithDelayedBeginTimeRectangle" 
                Storyboard.TargetProperty="Width"
                BeginTime="0:0:0" From="100" To="600" Duration="0:0:2" />
            </Storyboard>
          </BeginStoryboard>
        </EventTrigger>
      </Rectangle.Triggers>
    </Rectangle>    
  </StackPanel>
</Page>

注釈

BeginTimeプロパティは、シーケンスで再生タイムラインを作成するために役立ちます。 を増やすことで、BeginTime同じ親を共有する一連のタイムラインの、プレイ時間の時差を設定することができます。The BeginTime property is useful for creating timelines that play in a sequence: by increasing the BeginTime of successive timelines that share the same parent, you can stagger their play times.

負の値Negative Values

負の値BeginTime値の原因をTimelineを過去の時間で起動しているように動作します。A negative BeginTime value causes a Timeline to behave as though it started at some time in the past. など、Timelineで、BeginTime負 2.5 秒間のDuration5 秒間の半分に表示されます開始時に完了します。For example, a Timeline with a BeginTime of negative 2.5 seconds and a Duration of 5 seconds will appear to be half-way finished when it starts.

BeginTime、SpeedRatioBeginTime and SpeedRatio

指定された期間、BeginTimeプロパティは、タイムラインの親の時間で測定されます。The time described by the BeginTime property is measured in the timeline's parent's time. タイムラインなど、BeginTimeの親が 5、 SpeedRatio 2 の実際には、開始 2.5 秒後にします。For example, a timeline with a BeginTime of 5 whose parent has a SpeedRatio of 2 actually starts after 2.5 seconds.

タイムラインの独自SpeedRatio設定には影響しません、BeginTimeします。A timeline's own SpeedRatio setting does not affect its BeginTime. タイムラインなど、 BeginTime 、5 秒間のSpeedRatio2、および親タイムラインのSpeedRatio1 のない 2.5、5 秒後に開始します。For example, a timeline with a BeginTime of 5 seconds, a SpeedRatio of 2, and a parent timeline with a SpeedRatio of 1 starts after 5 seconds, not 2.5.

依存プロパティ情報Dependency Property Information

識別子フィールドです。Identifier field BeginTimeProperty
メタデータのプロパティを設定するには trueMetadata properties set to true なしNone

XAML 属性の使用方法XAML Attribute Usage

<object BeginTime="[-][days.]hours:minutes:seconds[.fractionalSeconds]"/><object BeginTime="[-][days.]hours:minutes:seconds[.fractionalSeconds]"/>

または-or-

<object BeginTime="[-][days.]hours:minutes"/><object BeginTime="[-][days.]hours:minutes"/>

または-or-

<object BeginTime="[-]days"/><object BeginTime="[-]days"/>

または-or-

<オブジェクト BeginTime="{X:null マークアップ拡張機能}"/><object BeginTime="{x:Null Markup Extension}"/>

XAML 値XAML Values

角かっこ内の項目 ([]) は省略可能です。Items in square brackets ([ and ]) are optional.

daysdays
System.Int32

この日数の数を示す 0 以上の値は開始時刻です。A value greater than or equal to 0 that describes the number of days spanned by this begin time.

時間hours
System.Int32

この時間数を表す、0 ~ 23 の値は開始時刻です。A value between 0 and 23 that represents the number of hours spanned by this begin time.

minutes
System.Int32

これにより展開される分数を表す 0 ~ 59 の範囲の値は開始時刻です。A value between 0 and 59 that represents the number of minutes spanned by this begin time.

secondsseconds
System.Int32

この秒数を表す 0 ~ 59 の範囲値は開始時刻です。A value between 0 and 59 that represents the number of seconds spanned by this begin time.

fractionalSecondsfractionalSeconds
System.Int32

秒の小数部を表す 1 ~ 7 桁で構成される値。A value consisting of 1 to 7 digits that represents fractional seconds.

完全なTimeSpan構文の「解説」を参照してください、Parseページ。For the complete TimeSpan syntax, see the Remarks section of the Parse page.

適用対象

こちらもご覧ください