Click here to Skip to main content
13,045,001 members (40,548 online)
Rate this:
Please Sign up or sign in to vote.
See more:
The problem: I want to animate adding and removing items from list view item, it is work for adding but removing did not work, i Will post the code and tel me where is the error how how i can do it??

XAML code:

        <controltemplate x:key="template" targettype="{x:Type ListViewItem}" xmlns:x="#unknown">
            <border removed="Red" cornerradius="5">
                <Label Content="{Binding Path=Name}" />
        <Style x:Key="Containerstyle" TargetType="{x:Type ListViewItem}">
            <setter property="Margin" value="2" />
            <setter property="Height" value="30" />
            <setter property="Template" value="{StaticResource template}" />
                <eventtrigger routedevent="Loaded">
                                <doubleanimation storyboard.targetproperty="Opacity" from="0" to="1" duration="0:0:2">
                <eventtrigger routedevent="Unloaded">
                                <doubleanimation storyboard.targetproperty="Opacity" from="1" to="1" duration="0:0:0" />
                                <doubleanimation storyboard.targetproperty="Opacity" from="1" to="0" duration="0:0:2">

        <listview height="217" horizontalalignment="Left" margin="111,12,0,0" name="listView1" verticalalignment="Top" width="254">
                   ItemsSource="{Binding Path=ListPerson}" />
        <Button Content="Add" Height="32" HorizontalAlignment="Left" Margin="119,252,0,0" Name="button1" VerticalAlignment="Top" Width="122" Click="button1_Click" />
        <Button Content="remove" Height="32" HorizontalAlignment="Left" Margin="263,252,0,0" Name="button2" VerticalAlignment="Top" Width="122" Click="button2_Click" />
Posted 1-Dec-12 0:36am
Updated 1-Dec-12 0:40am

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170713.1 | Last Updated 1 Dec 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100