Windows Phone - Listbox animate item when added
Really quick one that might help out others. This datatemplate is used in my listbox as follows:
[code language=“xml”] <ListBox ItemsSource="{Binding example}" ItemTemplate="{StaticResource ListNewsItem}" … /> [/code]
then the template looks as follows, mine is wrapped in a button as I then bind commands but I’ve removed that for this example.
[code language=“xml”]<DataTemplate x:Key=“ListNewsItem”>
<Button x:Name=“newsItemBtn”>
<Button.Resources>
<EventTrigger x:Name=“event” RoutedEvent=“Canvas.Loaded”>
<TextBlock Text="{Binding ItemBindingExample}"/> [/code]
You now get a nice fade in when the an item is added to the list rather than a rough jump, looks much nicer!