PointerDownThemeAnimation PointerDownThemeAnimation PointerDownThemeAnimation Class

Definition

Represents a preconfigured animation that runs when a pointer down is detected on an item or element.

public : sealed class PointerDownThemeAnimation : Timeline, IPointerDownThemeAnimation
public sealed class PointerDownThemeAnimation : Timeline, IPointerDownThemeAnimation
Public NotInheritable Class PointerDownThemeAnimation Inherits Timeline Implements IPointerDownThemeAnimation
<PointerDownThemeAnimation .../>
Inheritance
PointerDownThemeAnimationPointerDownThemeAnimationPointerDownThemeAnimation
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Examples

The following is an example of a template of a custom control that uses PointerDown/Up theme animations.


<!-- 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.-->
<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>
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:
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);
}

Remarks

Setting the Duration property has no effect on this object as the duration is preconfigured.

PointerDownThemeAnimation overrides the current values of Projection and RenderTransform.

Windows 8.1 and prior Projection and RenderTransform are not affected by PointerDownThemeAnimation.

Constructors

PointerDownThemeAnimation() PointerDownThemeAnimation() PointerDownThemeAnimation()

Initializes a new instance of the PointerDownThemeAnimation class.

public : PointerDownThemeAnimation()
public PointerDownThemeAnimation()
Public Sub New()
See Also

Properties

AllowDependentAnimations AllowDependentAnimations AllowDependentAnimations

Inherited from Timeline

AutoReverse AutoReverse AutoReverse

Inherited from Timeline

AutoReverseProperty AutoReverseProperty AutoReverseProperty

Inherited from Timeline

BeginTime BeginTime BeginTime

Inherited from Timeline

BeginTimeProperty BeginTimeProperty BeginTimeProperty

Inherited from Timeline

Dispatcher Dispatcher Dispatcher

Inherited from DependencyObject

Duration Duration Duration

Inherited from Timeline

DurationProperty DurationProperty DurationProperty

Inherited from Timeline

FillBehavior FillBehavior FillBehavior

Inherited from Timeline

FillBehaviorProperty FillBehaviorProperty FillBehaviorProperty

Inherited from Timeline

RepeatBehavior RepeatBehavior RepeatBehavior

Inherited from Timeline

RepeatBehaviorProperty RepeatBehaviorProperty RepeatBehaviorProperty

Inherited from Timeline

SpeedRatio SpeedRatio SpeedRatio

Inherited from Timeline

SpeedRatioProperty SpeedRatioProperty SpeedRatioProperty

Inherited from Timeline

TargetName TargetName TargetName

Gets or sets the reference name of the control element being targeted.

public : Platform::String TargetName { get; set; }
public string TargetName { get; set; }
Public ReadWrite Property TargetName As string
<PointerDownThemeAnimation TargetName="nameString" />

Value
Platform::String string string

The name of the control element being targeted.

See Also

TargetNameProperty TargetNameProperty TargetNameProperty

Identifies the TargetName dependency property.

public : static DependencyProperty TargetNameProperty { get; }
public static DependencyProperty TargetNameProperty { get; }
Public Static ReadOnly Property TargetNameProperty As DependencyProperty
Value
DependencyProperty DependencyProperty DependencyProperty

The identifier for the TargetName dependency property.

See Also

Methods

ClearValue(DependencyProperty) ClearValue(DependencyProperty) ClearValue(DependencyProperty)

Inherited from DependencyObject

GetAnimationBaseValue(DependencyProperty) GetAnimationBaseValue(DependencyProperty) GetAnimationBaseValue(DependencyProperty)

Inherited from DependencyObject

GetValue(DependencyProperty) GetValue(DependencyProperty) GetValue(DependencyProperty)

Inherited from DependencyObject

ReadLocalValue(DependencyProperty) ReadLocalValue(DependencyProperty) ReadLocalValue(DependencyProperty)

Inherited from DependencyObject

RegisterPropertyChangedCallback(DependencyProperty,DependencyPropertyChangedCallback) RegisterPropertyChangedCallback(DependencyProperty,DependencyPropertyChangedCallback) RegisterPropertyChangedCallback(DependencyProperty,DependencyPropertyChangedCallback)

Inherited from DependencyObject

SetValue(DependencyProperty,Object) SetValue(DependencyProperty,Object) SetValue(DependencyProperty,Object)

Inherited from DependencyObject

UnregisterPropertyChangedCallback(DependencyProperty,Int64) UnregisterPropertyChangedCallback(DependencyProperty,Int64) UnregisterPropertyChangedCallback(DependencyProperty,Int64)

Inherited from DependencyObject

Events

Completed Completed Completed

Inherited from Timeline

See Also