0

如何在 WinPhone 中为 Image 创建动画?我创建了 UniformGrid,它有 20 张图像。如何执行以下操作:按下图像时 - 播放动画?

我的项目控制:

 <ItemsControl.ItemTemplate>
                <DataTemplate>
                    <Image x:Name="imgSquare"
                           Source="{Binding Path=Square.ImagePath, Converter={StaticResource PathWP}}"                          
                           VerticalAlignment="Center"
                           HorizontalAlignment="Center"
                           Width="110" 
                           Height="110" 
                           Stretch="Fill">

                        <i:Interaction.Triggers>
                            <i:EventTrigger EventName="MouseLeftButtonDown">
                                <commandbinding:MvxEventToCommand Command="{Binding Path=DataContext.ClickCommand, ElementName=ImageList}" CommandParameter="{Binding}"/>
                            </i:EventTrigger>                            
                        </i:Interaction.Triggers>

                        <i:Interaction.Behaviors>
                            <behaviors:ImageBehavior SelectedSquareModel="{Binding}"/>
                        </i:Interaction.Behaviors>

                    </Image>
                </DataTemplate>
            </ItemsControl.ItemTemplate>
        </ItemsControl>

我打算使用 Behavior 播放动画:

<i:Interaction.Behaviors>
     <behaviors:ImageBehavior SelectedSquareModel="{Binding}"/>
</i:Interaction.Behaviors>

请告诉我如何创建动画并将其连接到图像?

对不起我的英语不好

4

1 回答 1

0

尝试搜索“ windows phone 中的动画

您会发现很多很棒的教程,其中大多数使用 Blend 和 Behaviors,例如: http: //www.jeffblankenburg.com/2010/10/29/31-days-of-windows-phone-day-29-animations/

对于在代码中完成的按钮按下动画,请参阅http://www.youtube.com/watch?v=5k8SG82e1Rc的中间几分钟- 尽管源代码是 ruby​​ !

于 2012-11-28T09:35:53.467 回答