PointerDownThemeAnimation 클래스

정의

항목 또는 요소에서 포인터가 감지될 때 실행되는 미리 구성된 애니메이션을 나타냅니다.

public ref class PointerDownThemeAnimation 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)]
class PointerDownThemeAnimation 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.Foundation.Metadata.Activatable(65536, "Windows.Foundation.UniversalApiContract")]
class PointerDownThemeAnimation 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)]
public sealed class PointerDownThemeAnimation : 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.Foundation.Metadata.Activatable(65536, "Windows.Foundation.UniversalApiContract")]
public sealed class PointerDownThemeAnimation : Timeline
Public NotInheritable Class PointerDownThemeAnimation
Inherits Timeline
<PointerDownThemeAnimation .../>
상속
Object Platform::Object IInspectable DependencyObject Timeline PointerDownThemeAnimation
특성

Windows 요구 사항

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

예제

다음은 PointerDown/Up 테마 애니메이션을 사용하는 사용자 지정 컨트롤 템플릿의 예입니다.

// Themes/Generic.xaml
<!-- Example template of a custom control that uses PointerDown/Up theme 
     animations. The PointerDownThemeAnimation will be run when the control
     is in the PointerDown state.-->
<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:BlankApp1">

    <Style TargetType="local:TapControl" >
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:TapControl">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="TapStates">
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="PointerDown">
                                    <Storyboard>
                                        <PointerDownThemeAnimation TargetName="contentRectangle"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="PointerUp">
                                    <Storyboard>
                                        <PointerUpThemeAnimation TargetName="contentRectangle"/>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Rectangle x:Name="contentRectangle" Width="100" Height="100" Fill="{TemplateBinding Background}"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>
public sealed class TapControl : Control
{
    public TapControl()
    {
        this.DefaultStyleKey = typeof(TapControl);
    }

    protected override void OnPointerPressed(PointerRoutedEventArgs e)
    {
        this.CapturePointer(e.Pointer);
        VisualStateManager.GoToState(this, "PointerDown", true);
    }

    protected override void OnPointerReleased(PointerRoutedEventArgs e)
    {
        VisualStateManager.GoToState(this, "PointerUp", true);
        this.ReleasePointerCapture(e.Pointer);
    }
}
// TapControl.h
struct TapControl : TapControlT<TapControl>
{
    TapControl(){ DefaultStyleKey(winrt::box_value(L"MyApp.TapControl")); }

    void OnPointerPressed(Windows::UI::Xaml::Input::PointerRoutedEventArgs const& e);
    void OnPointerReleased(Windows::UI::Xaml::Input::PointerRoutedEventArgs const& e);
};

// TapControl.cpp
void TapControl::OnPointerPressed(Windows::UI::Xaml::Input::PointerRoutedEventArgs const& e)
{
    CapturePointer(e.Pointer());
    // Go to the PointerDown state, which will start the PointerDownThemeAnimation.
    Windows::UI::Xaml::VisualStateManager::GoToState(*this, L"PointerDown", true);
}

void TapControl::OnPointerReleased(Windows::UI::Xaml::Input::PointerRoutedEventArgs const& e)
{
    Windows::UI::Xaml::VisualStateManager::GoToState(*this, L"PointerUp", true);
    ReleasePointerCapture(e.Pointer());
}
// TapControl.h:
public ref class TapControl sealed : public Windows::UI::Xaml::Controls::Control
{
public:
    TapControl();
protected:
    virtual void OnPointerPressed(Windows::UI::Xaml::Input::PointerRoutedEventArgs^ e) override;
    virtual void OnPointerReleased(Windows::UI::Xaml::Input::PointerRoutedEventArgs^ e) override;
};

// TapControl.cpp:
TapControl::TapControl()
{
    DefaultStyleKey = "MyApp.TapControl";
}

void SplitOpenControl::OnPointerPressed(PointerRoutedEventArgs^ e)
{
    CapturePointer(e->Pointer);
    VisualStateManager::GoToState(this, "PointerDown", true);
}

void SplitOpenControl::OnPointerReleased(PointerRoutedEventArgs^ e)
{
    VisualStateManager::GoToState(this, "PointerUp", true);
    ReleasePointerCapture(e->Pointer);
}

설명

Duration 속성을 설정해도 기간이 미리 구성되어 있으므로 이 개체에는 영향을 주지 않습니다.

PointerDownThemeAnimation은 프로젝션RenderTransform의 현재 값을 재정의합니다.

Windows 8.1 및 이전프로젝션RenderTransform은 PointerDownThemeAnimation의 영향을 받지 않습니다.

생성자

PointerDownThemeAnimation()

PointerDownThemeAnimation 클래스의 새 instance 초기화합니다.

속성

AutoReverse

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

(다음에서 상속됨 Timeline)
BeginTime

타임라인 을 시작할 시간을 가져오거나 설정합니다.

(다음에서 상속됨 Timeline)
Dispatcher

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

(다음에서 상속됨 DependencyObject)
Duration

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

(다음에서 상속됨 Timeline)
FillBehavior

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

(다음에서 상속됨 Timeline)
RepeatBehavior

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

(다음에서 상속됨 Timeline)
SpeedRatio

타임라인에 대해 진행되는 부모에 상대적인 속도를 가져오거나 설정합니다.

(다음에서 상속됨 Timeline)
TargetName

대상으로 지정되는 컨트롤 요소의 참조 이름을 가져오거나 설정합니다.

TargetNameProperty

TargetName 종속성 속성을 식별합니다.

메서드

ClearValue(DependencyProperty)

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

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

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

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

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

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

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

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

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

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

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

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

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

(다음에서 상속됨 DependencyObject)

이벤트

Completed

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

(다음에서 상속됨 Timeline)

적용 대상

추가 정보