Windows Phone 8.1 缩放动画

network | | 访问(32)
<Canvas>
    <Canvas.Resources>
        <Storyboard x:Name="storyBoard">
            <DoubleAnimation Storyboard.TargetName="scaleTransform" Storyboard.TargetProperty="ScaleY" 
                                         From="1" To="2" Duration="0:0:3" RepeatBehavior="Forever" AutoReverse="True">
            </DoubleAnimation>
        </Storyboard>
    </Canvas.Resources>
    <Rectangle x:Name="rectangle" Height="50" Width="50" Canvas.Left="75" Canvas.Top="75" Fill="Blue">
        <Rectangle.RenderTransform>
            <ScaleTransform x:Name="scaleTransform"></ScaleTransform>
        </Rectangle.RenderTransform>
    </Rectangle>
</Canvas>
public sealed partial class MainPage: Page {
    public MainPage() {
        this.InitializeComponent();
        //动画开始
        storyBoard.Begin();
    }

    protected override void OnNavigatedTo(NavigationEventArgs e) {}
}