C# windows phone 7: Animating ListBoxItems created via DataTemplate
I have this xaml:
<ListBox Margin="12,0,0,0" Height="50" FontSize="30" Name="resultListBox">
<ListBox.ItemTemplate>
<DataTemplate>
<toolkit:WrapPanel Margin="0,0,24,0" Background="{Binding Path=background}" Orientation="Horizontal" HorizontalAlignment="Stretch">
<TextBlock Margin="0,0,12,0" Width="49" Text="{Binding Path=line}" />
<TextBlock Width="261" Text="{Binding Path=destination}" />
<TextBlock Margin="0,0,12,0" Width="49" Text="{Binding Path=next}" />
<TextBlock Width="49" Text="{Binding Path=nextNext}" />
<toolkit:WrapPanel.Projection>
<PlaneProjection CenterOfRotationY="0.5" x:Name="WrapPanelPP{Binding Path=ID}" RotationX="-90" />
</toolki开发者_C百科t:WrapPanel.Projection>
</toolkit:WrapPanel>
</DataTemplate>
</ListBox.ItemTemplate>
And i would like to animate the plane projection of each item. What do do?
Thanks!
There are two possible ways you can handle this.
- Use Expression Blend to create storyboards and call the storyboards on proper trigger. or
- In code behind you can create a instance of Storyboard and target the "(UIElement.Projection).(RotationX)" property on the item.
精彩评论