Mark13426
Mark13426

Reputation: 2639

Disabling tap animation in ListView in WP 8.1

In WP 8.1, how do I remove the default animation in ListView when an item is tapped and it's skewed/translated in different directions depending on where the tap occurs? I want no item click animation.

Upvotes: 2

Views: 2598

Answers (1)

Rob Caplan - MSFT
Rob Caplan - MSFT

Reputation: 21899

The animation comes from the ListView's ItemContainerStyle's "Pressed" state.

In the designer select your ListView, right click, and choose "Edit Additional Templates.Edit Generated Item Container (ItemContainerStyle).Edit a copy..."

This will generate a style with TargetType="ListViewItem":

<Style x:Key="ListViewItemStyle1" TargetType="ListViewItem">

In the style find the Visual State for "Pressed" and alter or remove the animation:

<VisualState x:Name="Pressed">
    <Storyboard>
        <!--<PointerDownThemeAnimation Storyboard.TargetName="TiltContainer"/>-->
    </Storyboard>
</VisualState>

If you want to replace the animation rather than just removing it then Blend is an excellent tool for editing Visual States and animations. If you're supporting clicking or tapping then you should provide some indication to the user what is going on, but you can change it here to what you need. You can also alter other VisualStates as needed.

Upvotes: 10

Related Questions