On the form there are three listviews. Each ListView needs to add a different animation to add items. In ResourceDictionary I create several styles for a ListViewItem like this:

<Style TargetType="ListViewItem" x:Key="SlideRightStyle"> <Setter Property="LayoutTransform"> <Setter.Value> <ScaleTransform x:Name="transform" /> </Setter.Value> </Setter> <Style.Triggers> <EventTrigger RoutedEvent="Loaded"> <EventTrigger.Actions> <BeginStoryboard> <Storyboard> <DoubleAnimation Duration="0:0:2" From="0" Storyboard.TargetProperty="Opacity" To="1" /> <DoubleAnimation Duration="0:0:.2" From="0" Storyboard.TargetProperty="LayoutTransform.ScaleX" /> </Storyboard> </BeginStoryboard> </EventTrigger.Actions> </EventTrigger> </Style.Triggers> </Style> 

The problem is that the specified style is automatically applied to all the ListView on the form. How to specify a style for a specific ListView?

    1 answer 1

    Try this:

     <ListView ItemContainerStyle="{StaticResource SlideRightStyle}"> ... </ListView>