silverlight animation example

來源:互聯網
上載者:User

標籤:

http://samples.msdn.microsoft.com/Silverlight/SampleBrowser/index.htm#/   

Silverlight Documentation Samples

https://social.msdn.microsoft.com/Forums/silverlight/en-US/2a79ccc0-b012-4a7b-ad74-19a1500907fc/how-to-move-an-image-control-with-animation

how to MOVE an Image control with animation

http://www.c-sharpcorner.com/uploadfile/anavijai/silverlight-doubleanimation-example/

Silverlight DoubleAnimation Example

1. 

<UserControl    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"    xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk" x:Class="SilverlightApplication1.MainPage"    mc:Ignorable="d" Height="504.478" Width="940.299">    <Grid x:Name="LayoutRoot" Background="Green">        <Canvas Margin="0,-35,0,35">            <Canvas.Resources>                <Storyboard x:Name="storyboard1">                    <DoubleAnimation                      Storyboard.TargetName="image1"                      Storyboard.TargetProperty="Opacity"                      From="1.0" To="0.0" Duration="0:0:1"                       AutoReverse="True"                       RepeatBehavior="Forever" />                </Storyboard>                                <Storyboard x:Name="storyboard2">                    <DoubleAnimation                         Storyboard.TargetProperty="(Canvas.Left)" From="50" To="250"                        Storyboard.TargetName="image1" Duration="0:0:0.5" />                </Storyboard>                <Storyboard x:Name="storyboard3">                    <DoubleAnimation                         Storyboard.TargetProperty="(Canvas.Top)" From="50" To="250"                        Storyboard.TargetName="image1" Duration="0:0:0.5" />                </Storyboard>            </Canvas.Resources>            <Button x:Name="button1" Content="Generate" HorizontalAlignment="Left" Margin="473,55,0,0" VerticalAlignment="Top" Width="106" Height="56" Click="Button_Click_1"/>            <Image x:Name="image1"  Source="/res/boss.png"  HorizontalAlignment="Left" Height="100" VerticalAlignment="Top" Width="100" Canvas.Left="261" Canvas.Top="285"/>        </Canvas>    </Grid></UserControl>

2. in cs code use begin() to call a storyboard

storyboard1.Begin();

 

silverlight animation example

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.