<window.resources> <controltemplate x:key="template" targettype="{x:Type ListViewItem}" xmlns:x="#unknown"> <border removed="Red" cornerradius="5"> <Label Content="{Binding Path=Name}" /> </border> </controltemplate> <Style x:Key="Containerstyle" TargetType="{x:Type ListViewItem}"> <setter property="Margin" value="2" /> <setter property="Height" value="30" /> <setter property="Template" value="{StaticResource template}" /> <Style.Triggers> <eventtrigger routedevent="Loaded"> <eventtrigger.actions> <beginstoryboard> <storyboard> <doubleanimation storyboard.targetproperty="Opacity" from="0" to="1" duration="0:0:2"> </doubleanimation> </storyboard> </beginstoryboard> </eventtrigger.actions> </eventtrigger> <eventtrigger routedevent="Unloaded"> <eventtrigger.actions> <beginstoryboard> <storyboard> <doubleanimation storyboard.targetproperty="Opacity" from="1" to="1" duration="0:0:0" /> <doubleanimation storyboard.targetproperty="Opacity" from="1" to="0" duration="0:0:2"> </doubleanimation> </storyboard> </beginstoryboard> </eventtrigger.actions> </eventtrigger> </Style.Triggers> </Style> </window.resources> <grid> <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" /> </listview></grid>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)