PointerUpThemeAnimation PointerUpThemeAnimation PointerUpThemeAnimation Class

Definition

Represents a preconfigured animation that runs after a pointer down is detected on an item or element and the tap action is released.

public sealed class PointerUpThemeAnimationpublic sealed class PointerUpThemeAnimationPublic NotInheritable Class PointerUpThemeAnimation
<PointerUpThemeAnimation .../>
Inheritance
PointerUpThemeAnimationPointerUpThemeAnimationPointerUpThemeAnimation
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Inherited Members

Inherited properties

Inherited methods

Inherited events

Remarks

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

PointerUpThemeAnimation overrides the current values of Projection and RenderTransform and sets them to their default values.

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

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 PointerUpThemeAnimation will be run when the control is in the PointerUp 
     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);
}

Constructors

PointerUpThemeAnimation() PointerUpThemeAnimation() PointerUpThemeAnimation() PointerUpThemeAnimation()

Initializes a new instance of the PointerDownThemeAnimation class.

public PointerUpThemeAnimation()public New()Public Sub New()public PointerUpThemeAnimation()
Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Properties

TargetName TargetName TargetName TargetName

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

public string TargetName { get; set; }public string TargetName { get; set; }Public ReadWrite Property TargetName As stringpublic string TargetName { get; set; }
<PointerUpThemeAnimation TargetName="nameString" />

Value
string string string

The reference name. This is typically the x:Name of the relevant element as declared in XAML.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

TargetNameProperty TargetNameProperty TargetNameProperty TargetNameProperty

Identifies the TargetName dependency property.

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

The identifier for the TargetName dependency property.

Attributes
Additional features and requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)