开发者

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.

  1. Use Expression Blend to create storyboards and call the storyboards on proper trigger. or
  2. In code behind you can create a instance of Storyboard and target the "(UIElement.Projection).(RotationX)" property on the item.


0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜