-api-id | -api-type |
---|---|
T:Windows.UI.Xaml.Media.Animation.DragOverThemeAnimation |
winrt class |
Represents the preconfigured animation that applies to the elements underneath an element being dragged.
<DragItemThemeAnimation .../>
Note that setting the Duration property has no effect on this object since the duration is preconfigured.
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>
Timeline, Animating drag-and-drop sequences, Guidelines and checklist for drag-and-drop animations