ObjectAnimationUsingKeyFrames 클래스

정의

지정된 개체 이상의 집합을 따라 Object 속성의 KeyFrames 값에 애니메이션 효과를 니다 Duration.

UWP에 해당하는 WinUI 2 API: Microsoft.UI.Xaml.Media.Animation.ObjectAnimationUsingKeyFrames(Windows 앱 SDK WinUI의 경우 Windows 앱 SDK 네임스페이스 참조).

public ref class ObjectAnimationUsingKeyFrames sealed : Timeline
/// [Windows.Foundation.Metadata.Activatable(65536, Windows.Foundation.UniversalApiContract)]
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
/// [Windows.UI.Xaml.Markup.ContentProperty(Name="KeyFrames")]
class ObjectAnimationUsingKeyFrames final : Timeline
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
/// [Windows.UI.Xaml.Markup.ContentProperty(Name="KeyFrames")]
/// [Windows.Foundation.Metadata.Activatable(65536, "Windows.Foundation.UniversalApiContract")]
class ObjectAnimationUsingKeyFrames final : Timeline
[Windows.Foundation.Metadata.Activatable(65536, typeof(Windows.Foundation.UniversalApiContract))]
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
[Windows.UI.Xaml.Markup.ContentProperty(Name="KeyFrames")]
public sealed class ObjectAnimationUsingKeyFrames : Timeline
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
[Windows.UI.Xaml.Markup.ContentProperty(Name="KeyFrames")]
[Windows.Foundation.Metadata.Activatable(65536, "Windows.Foundation.UniversalApiContract")]
public sealed class ObjectAnimationUsingKeyFrames : Timeline
Public NotInheritable Class ObjectAnimationUsingKeyFrames
Inherits Timeline
<ObjectAnimationUsingKeyFrames>oneOrMoreDiscreteObjectKeyFrames</ObjectAnimationUsingKeyFrames>
상속
Object IInspectable DependencyObject Timeline ObjectAnimationUsingKeyFrames
특성

Windows 요구 사항

디바이스 패밀리
Windows 10 (10.0.10240.0에서 도입되었습니다.)
API contract
Windows.Foundation.UniversalApiContract (v1.0에서 도입되었습니다.)

예제

다음 예제에서는 ObjectAnimationUsingKeyFrames 클래스를 Fill Rectangle사용하여 . 이 애니메이션은 다음과 같은 방식으로 두 개의 키 프레임을 사용합니다.

  1. DiscreteObjectKeyFrameFill 사용하면 애니메이션의 Rectangle 처음 2초 후의 LinearGradientBrush 속성이 갑자기 변경됩니다.
  2. 애니메이션 Fill 의 세 번째 초 후 속성이 갑자기 다른 LinearGradientBrush값으로 변경되며 애니메이션이 끝날 때까지 유지됩니다(총 4초).
<StackPanel>
    <StackPanel.Resources>
        <Storyboard x:Name="myStoryboard">

            <!-- ObjectAnimationUsingKeyFrames is used to animate properties that take
         an object as a value. This animation lasts for 4 seconds using 3 KeyFrames which
         swap different brush objects at regular intervals, making the background of the Page
         change. -->
            <ObjectAnimationUsingKeyFrames
         Storyboard.TargetName="animatedRectangle"
         Storyboard.TargetProperty="Fill"
         Duration="0:0:4" RepeatBehavior="Forever">
                <ObjectAnimationUsingKeyFrames.KeyFrames>

                    <!-- Note: Only discrete interpolation (DiscreteObjectKeyFrame) is available for 
                use with ObjectAnimationUsingKeyFrames which merely swaps objects according to
                a specified timeline. Other types of interpolation are too problematic to apply
                to objects.  -->
                    <!-- Using a DiscreteObjectKeyFrame, the Fill property of the Rectangle suddenly  
                changes to a LinearGradientBrush after the first two seconds of the animation. -->
                    <DiscreteObjectKeyFrame KeyTime="0:0:2">
                        <DiscreteObjectKeyFrame.Value>
                            <LinearGradientBrush>
                                <LinearGradientBrush.GradientStops>
                                    <GradientStop Color="Yellow" Offset="0.0" />
                                    <GradientStop Color="Orange" Offset="0.5" />
                                    <GradientStop Color="Red" Offset="1.0" />
                                </LinearGradientBrush.GradientStops>
                            </LinearGradientBrush>
                        </DiscreteObjectKeyFrame.Value>
                    </DiscreteObjectKeyFrame>

                    <!-- After the third second of the animation, the Fill property is suddenly changed 
                to a different LinearGradientBrush which remains until the end of the animation 
                (4 seconds total). -->
                    <DiscreteObjectKeyFrame KeyTime="0:0:3">
                        <DiscreteObjectKeyFrame.Value>
                            <LinearGradientBrush>
                                <LinearGradientBrush.GradientStops>
                                    <GradientStop Color="White" Offset="0.0" />
                                    <GradientStop Color="MediumBlue" Offset="0.5" />
                                    <GradientStop Color="Black" Offset="1.0" />
                                </LinearGradientBrush.GradientStops>
                            </LinearGradientBrush>
                        </DiscreteObjectKeyFrame.Value>
                    </DiscreteObjectKeyFrame>

                </ObjectAnimationUsingKeyFrames.KeyFrames>
            </ObjectAnimationUsingKeyFrames>
        </Storyboard>
    </StackPanel.Resources>

    <!-- The Fill property of this rectangle is animated. -->
    <Rectangle x:Name="animatedRectangle" Loaded="Rectangle_Loaded" Width="300" Height="300" />

</StackPanel>
// When the rectangle loads, begin the animation.
private void Rectangle_Loaded(object sender, RoutedEventArgs e)
{
    myStoryboard.Begin();
}
' When the rectangle loads, begin the animation.
Private Sub Rectangle_Loaded(ByVal sender As Object, ByVal e As EventArgs)
    myStoryboard.Begin()
End Sub

생성자

ObjectAnimationUsingKeyFrames()

ObjectAnimationUsingKeyFrames 클래스의 새 인스턴스를 초기화합니다.

속성

AutoReverse

타임라인이 앞으로 반복을 완료한 후 반대 방향으로 재생되는지 여부를 나타내는 값을 가져오거나 설정합니다.

UWP에 해당하는 WinUI 2 API: Microsoft.UI.Xaml.Media.Animation.Timeline.AutoReverse(Windows 앱 SDK WinUI의 경우 Windows 앱 SDK 네임스페이스 참조).

(다음에서 상속됨 Timeline)
BeginTime

Timeline이 시작되어야 하는 시간을 가져오거나 설정합니다.

UWP에 해당하는 WinUI 2 API: Microsoft.UI.Xaml.Media.Animation.Timeline.BeginTime(Windows 앱 SDK WinUI의 경우 Windows 앱 SDK 네임스페이스 참조).

(다음에서 상속됨 Timeline)
Dispatcher

이 개체가 CoreDispatcher 연결된 개체를 가져옵니다. 코드 CoreDispatcher 가 비 UI 스레드에서 시작되는 경우에도 UI 스레드에 액세스할 DependencyObject 수 있는 기능을 나타냅니다.

UWP에 해당하는 WinUI 2 API: Microsoft.UI.Xaml.DependencyObject.Dispatcher(Windows 앱 SDK WinUI의 경우 Windows 앱 SDK 네임스페이스 참조).

(다음에서 상속됨 DependencyObject)
Duration

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

UWP에 해당하는 WinUI 2 API: Microsoft.UI.Xaml.Media.Animation.Timeline.Duration(Windows 앱 SDK WinUI의 경우 Windows 앱 SDK 네임스페이스 참조).

(다음에서 상속됨 Timeline)
EnableDependentAnimation

종속 애니메이션으로 간주되는 애니메이션 속성에서 이 애니메이션 선언을 사용할 수 있는지 여부를 선언하는 값을 가져오거나 설정합니다.

UWP에 해당하는 WinUI 2 API: Microsoft.UI.Xaml.Media.Animation.ObjectAnimationUsingKeyFrames.EnableDependentAnimation(Windows 앱 SDK WinUI의 경우 Windows 앱 SDK 네임스페이스 참조).

EnableDependentAnimationProperty

EnableDependentAnimation 종속성 속성을 나타냅니다.

UWP에 해당하는 WinUI 2 API: Microsoft.UI.Xaml.Media.Animation.ObjectAnimationUsingKeyFrames.EnableDependentAnimationProperty(Windows 앱 SDK WinUI의 경우 Windows 앱 SDK 네임스페이스 참조).

FillBehavior

애니메이션이 활성 기간의 끝에 도달한 후 동작하는 방식을 지정하는 값을 가져오거나 설정합니다.

UWP에 해당하는 WinUI 2 API: Microsoft.UI.Xaml.Media.Animation.Timeline.FillBehavior(Windows 앱 SDK WinUI의 경우 Windows 앱 SDK 네임스페이스 참조).

(다음에서 상속됨 Timeline)
KeyFrames

애니메이션을 정의하는 개체의 ObjectKeyFrame 컬렉션을 가져옵니다.

UWP에 해당하는 WinUI 2 API: Microsoft.UI.Xaml.Media.Animation.ObjectAnimationUsingKeyFrames.KeyFrames(Windows 앱 SDK WinUI의 경우 Windows 앱 SDK 네임스페이스 참조).

RepeatBehavior

이 타임라인의 반복 동작을 가져오거나 설정합니다.

UWP에 해당하는 WinUI 2 API: Microsoft.UI.Xaml.Media.Animation.Timeline.RepeatBehavior(Windows 앱 SDK WinUI의 경우 Windows 앱 SDK 네임스페이스 참조).

(다음에서 상속됨 Timeline)
SpeedRatio

Timeline에 대한 진행 속도로 부모에 상대적인 비율을 가져오거나 설정합니다.

UWP에 해당하는 WinUI 2 API: Microsoft.UI.Xaml.Media.Animation.Timeline.SpeedRatio(Windows 앱 SDK WinUI의 경우 Windows 앱 SDK 네임스페이스 참조).

(다음에서 상속됨 Timeline)

메서드

ClearValue(DependencyProperty)

종속성 속성의 로컬 값을 지웁니다.

UWP에 해당하는 WinUI 2 API: Microsoft.UI.Xaml.DependencyObject.ClearValue(Windows 앱 SDK WinUI의 경우 Windows 앱 SDK 네임스페이스 참조).

(다음에서 상속됨 DependencyObject)
GetAnimationBaseValue(DependencyProperty)

애니메이션이 활성화되지 않은 경우에 적용되는 종속성 속성에 대해 설정된 기본 값을 반환합니다.

UWP에 해당하는 WinUI 2 API: Microsoft.UI.Xaml.DependencyObject.GetAnimationBaseValue(Windows 앱 SDK WinUI의 경우 Windows 앱 SDK 네임스페이스 참조).

(다음에서 상속됨 DependencyObject)
GetValue(DependencyProperty)

에서 종속성 속성 DependencyObject의 현재 유효 값을 반환합니다.

UWP에 해당하는 WinUI 2 API: Microsoft.UI.Xaml.DependencyObject.GetValue(Windows 앱 SDK WinUI의 경우 Windows 앱 SDK 네임스페이스 참조).

(다음에서 상속됨 DependencyObject)
ReadLocalValue(DependencyProperty)

로컬 값이 설정된 경우 종속성 속성의 로컬 값을 반환합니다.

UWP에 해당하는 WinUI 2 API: Microsoft.UI.Xaml.DependencyObject.ReadLocalValue(Windows 앱 SDK WinUI의 경우 Windows 앱 SDK 네임스페이스 참조).

(다음에서 상속됨 DependencyObject)
RegisterPropertyChangedCallback(DependencyProperty, DependencyPropertyChangedCallback)

DependencyObject 인스턴스의 특정 DependencyProperty 변경 내용을 수신 대기하기 위한 알림 함수를 등록합니다.

UWP에 해당하는 WinUI 2 API: Microsoft.UI.Xaml.DependencyObject.RegisterPropertyChangedCallback(Windows 앱 SDK WinUI의 경우 Windows 앱 SDK 네임스페이스 참조).

(다음에서 상속됨 DependencyObject)
SetValue(DependencyProperty, Object)

에 종속성 속성 DependencyObject의 로컬 값을 설정합니다.

UWP에 해당하는 WinUI 2 API: Microsoft.UI.Xaml.DependencyObject.SetValue(Windows 앱 SDK WinUI의 경우 Windows 앱 SDK 네임스페이스 참조).

(다음에서 상속됨 DependencyObject)
UnregisterPropertyChangedCallback(DependencyProperty, Int64)

를 호출 RegisterPropertyChangedCallback하여 이전에 등록한 변경 알림을 취소합니다.

UWP에 해당하는 WinUI 2 API: Microsoft.UI.Xaml.DependencyObject.UnregisterPropertyChangedCallback(Windows 앱 SDK WinUI의 경우 Windows 앱 SDK 네임스페이스 참조).

(다음에서 상속됨 DependencyObject)

이벤트

Completed

개체 재생이 Storyboard 완료되면 발생합니다.

UWP에 해당하는 WinUI 2 API: Microsoft.UI.Xaml.Media.Animation.Timeline.Completed(Windows 앱 SDK WinUI의 경우 Windows 앱 SDK 네임스페이스 참조).

(다음에서 상속됨 Timeline)

적용 대상

추가 정보