Windows phone 7 如何使用故事板

Windows phone 7 如何使用故事板,windows-phone-7,storyboard,Windows Phone 7,Storyboard,我希望停止使用Dispatchermer来显示动画,因为这是非常不可预测的。相反,我想开始使用故事板,因为这显然是最好、最有效的控件动画制作方法 我尝试过搜索教程,但不幸的是,还没有找到一本 谁能告诉我从哪里开始?例如,“在屏幕上移动图像”,然后“在旋转图像的同时移动多个图像”。关于windows phone 7中的情节提要动画,有很多信息。以下是几个链接: ) 这里有一些代码可以帮助您入门 这将设置一个简单矩形的动画,使其在屏幕上来回移动 <phone:PhoneApplication

我希望停止使用Dispatchermer来显示动画,因为这是非常不可预测的。相反,我想开始使用故事板,因为这显然是最好、最有效的控件动画制作方法

我尝试过搜索教程,但不幸的是,还没有找到一本


谁能告诉我从哪里开始?例如,“在屏幕上移动图像”,然后“在旋转图像的同时移动多个图像”。

关于windows phone 7中的情节提要动画,有很多信息。以下是几个链接:

)

这里有一些代码可以帮助您入门

这将设置一个简单矩形的动画,使其在屏幕上来回移动

<phone:PhoneApplicationPage 
    x:Class="PhoneApp1.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="768"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    shell:SystemTray.IsVisible="True">

    <Grid x:Name="LayoutRoot" Background="Transparent">
        <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
            <Rectangle x:Name="rect" Height="25" Width="25" Fill="Red" HorizontalAlignment="Left" VerticalAlignment="Top">
                <Rectangle.RenderTransform>
                    <TranslateTransform x:Name="transform" />
                </Rectangle.RenderTransform>
                <Rectangle.Triggers>
                    <EventTrigger RoutedEvent="Rectangle.Loaded">
                        <BeginStoryboard>
                            <Storyboard>
                                <DoubleAnimation
                                    Storyboard.TargetName="transform"
                                    Storyboard.TargetProperty="X"
                                    From="0" To="100" Duration="0:0:1" AutoReverse="True" RepeatBehavior="Forever" />
                            </Storyboard>
                        </BeginStoryboard>
                    </EventTrigger>
                </Rectangle.Triggers>
            </Rectangle>
        </Grid>
    </Grid>


</phone:PhoneApplicationPage>


MSDN网站上储存的信息,我并不是那么“高级”的人。我必须主要看真实的代码,分析和理解它。然后付诸实践。你提供的第二个链接看起来很好。我去看看。谢谢,先生,没问题。请参阅我的编辑,以获取一个简单的示例,帮助您入门。Windows Phone中没有触发器。代码来自WPF而不是Windows Phone。@KateBrown,Windows Phone中有触发器。你的版本是什么?