DragOverThemeAnimation DragOverThemeAnimation DragOverThemeAnimation Class

Represents the preconfigured animation that applies to the elements underneath an element being dragged.

Syntax

Declaration

public sealed class DragOverThemeAnimationpublic sealed class DragOverThemeAnimationPublic NotInheritable Class DragOverThemeAnimation
<DragItemThemeAnimation .../>

Inheritance Hierarchy

Inherited Members

, , , , , , , , , , , , , , , , , , , , ,

Remarks

Note that setting the Duration property has no effect on this object since the duration is preconfigured.

Examples

The following is an example of a template for a custom control that animates as another element is being dragged over it.

<Style x:Key="ListViewItemStyle1" TargetType="ListViewItem">
    <Setter Property="Template">
        <Setter.Value>
            <ControlTemplate TargetType="ListViewItem">
                <Border x:Name="OuterContainer">
                    <VisualStateManager.VisualStateGroups>                        
                        <!—Reordering hint VisualStates of the ListViewItem control which use 
                             DragOverThemeAnimation. -->
                        <VisualStateGroup x:Name="ReorderHintStates">
                            <VisualStateGroup.Transitions>
                                <VisualTransition GeneratedDuration="0:0:0.650" To="NoReorderHint"/>
                            </VisualStateGroup.Transitions>
                            <VisualState x:Name="NoReorderHint"/>
                            <VisualState x:Name="BottomReorderHint">
                                <Storyboard>
                                    <DragOverThemeAnimation 
                                          Direction="Bottom" 
                                          ToOffset="{StaticResource ListViewItemReorderHintThemeOffset}"
                                          TargetName="ReorderHintContent"
                              />
                                </Storyboard>
                            </VisualState>
                            <VisualState x:Name="TopReorderHint">
                                <Storyboard>
                                    <DragOverThemeAnimation 
                                          Direction="Top" 
                                          ToOffset="{StaticResource ListViewItemReorderHintThemeOffset}"
                                          TargetName="ReorderHintContent"
                              />
                                </Storyboard>
                            </VisualState>
                            <VisualState x:Name="RightReorderHint">
                                <Storyboard>
                                    <DragOverThemeAnimation 
                                          Direction="Right" 
                                          ToOffset="{StaticResource ListViewItemReorderHintThemeOffset}"
                                          TargetName="ReorderHintContent"
                              />
                                </Storyboard>
                            </VisualState>
                            <VisualState x:Name="LeftReorderHint">
                                <Storyboard>
                                    <DragOverThemeAnimation 
                                          Direction="Left" 
                                          ToOffset="{StaticResource ListViewItemReorderHintThemeOffset}"
                                          TargetName="ReorderHintContent"
                              />
                                </Storyboard>
                            </VisualState>
                        </VisualStateGroup>

                        <!-- Additional state groups here. -->

                    </VisualStateManager.VisualStateGroups>

                    <!-- Template content here. -->

            </ControlTemplate>
        </Setter.Value>
    </Setter>
</Style>

Constructors summary

Initializes a new instance of the DragOverThemeAnimation class.

Properties summary

Gets or sets the direction that the target should translate, when the animation is active.

Identifies the Direction dependency property.

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

Identifies the TargetName dependency property.

Gets or sets the distance by which the target is translated when the animation is active.

Identifies the ToOffset dependency property.

Constructors

  • DragOverThemeAnimation()
    DragOverThemeAnimation()
    DragOverThemeAnimation()
    DragOverThemeAnimation()

    Initializes a new instance of the DragOverThemeAnimation class.

    public DragOverThemeAnimation()public DragOverThemeAnimation()Public Function DragOverThemeAnimation() As

Properties

  • Direction
    Direction
    Direction
    Direction

    Gets or sets the direction that the target should translate, when the animation is active.

    public AnimationDirection Direction { get; set; }public AnimationDirection Direction { get; set; }Public ReadWrite Property Direction As AnimationDirection
    <DragOverThemeAnimation Direction="animationDirectionMemberName" />
    

    Property Value

  • DirectionProperty
    DirectionProperty
    DirectionProperty
    DirectionProperty

    Identifies the Direction dependency property.

    public static DependencyProperty DirectionProperty { get; }public static DependencyProperty DirectionProperty { get; }Public Static ReadOnly Property DirectionProperty As DependencyProperty

    Property Value

  • 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 string
    <DragOverThemeAnimation TargetName="nameString" />
    

    Property Value

    • string
      string
      string

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

  • 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 DependencyProperty

    Property Value

  • ToOffset
    ToOffset
    ToOffset
    ToOffset

    Gets or sets the distance by which the target is translated when the animation is active.

    public double ToOffset { get; set; }public double ToOffset { get; set; }Public ReadWrite Property ToOffset As double
    <DragOverThemeAnimation ToOffset="double" />
    

    Property Value

    • double
      double
      double

      The offset, in pixels.

    Remarks

    The direction of the offset is controlled by Direction.

  • ToOffsetProperty
    ToOffsetProperty
    ToOffsetProperty
    ToOffsetProperty

    Identifies the ToOffset dependency property.

    public static DependencyProperty ToOffsetProperty { get; }public static DependencyProperty ToOffsetProperty { get; }Public Static ReadOnly Property ToOffsetProperty As DependencyProperty

    Property Value

Device family

Windows 10 (introduced v10.0.10240.0)

API contract

Windows.Foundation.UniversalApiContract (introduced v1)

Attributes

Windows.Foundation.Metadata.ContractVersionAttribute
Windows.Foundation.Metadata.MarshalingBehaviorAttribute
Windows.Foundation.Metadata.ThreadingAttribute
Windows.Foundation.Metadata.WebHostHiddenAttribute
Windows.Foundation.Metadata.ActivatableAttribute
Windows.Foundation.Metadata.StaticAttribute

Details

Assembly

Windows.UI.Xaml.Media.Animation.dll