Quantcast
Channel: WPF simle animation...need help
Viewing all articles
Browse latest Browse all 14

WPF simle animation...need help

$
0
0

Here is the full code for each line animating seperately:

 <Grid>
        <Canvas Height="104" HorizontalAlignment="Left" Margin="74,24,0,0" Name="Canvas1" VerticalAlignment="Top" Width="164" />
        <Line x:Name="linia0" Opacity="0"
                    X1="150" Y1="150"
                    X2="350" Y2="290"
                    Stroke="Black"
                    StrokeThickness="3" Margin="-9,-12,0,0" />
        <Line x:Name="linia1" Opacity="0"
    X1="142" Y1="138"
    X2="300" Y2="50"
    Stroke="Black"
    StrokeThickness="3" />
        <Line x:Name="linia2" Opacity="0"
    X1="299" Y1="51"
    X2="340" Y2="278"
    Stroke="Black"
    StrokeThickness="3" />
        <Line x:Name="linia3" Opacity="0"
    X1="142" Y1="138"
    X2="320" Y2="164"
    Stroke="Red"
    StrokeThickness="4" />
        <Line x:Name="linia4" Opacity="0"
    X1="300" Y1="50"
    X2="240" Y2="207"
    Stroke="Red"
    StrokeThickness="4" />
        <Line x:Name="linia5" Opacity="0"
    X1="340" Y1="278"
    X2="220" Y2="93"
    Stroke="Red"
    StrokeThickness="4" />
        <StackPanel x:Name="rootElement">
            <StackPanel.Resources>
                  <Storyboard x:Key="mystoryboard">
                    <DoubleAnimation
                        Storyboard.TargetName="linia0"
                        Storyboard.TargetProperty="Opacity"
                        From="0.0" To="1.0" Duration="0:0:5"
                        AutoReverse="False"  />
                    <DoubleAnimation
                        Storyboard.TargetName="linia1"
                        Storyboard.TargetProperty="Opacity"
                        From="0.0" To="1.0" Duration="0:0:10"/>
                          <DoubleAnimation
                        Storyboard.TargetName="linia2"
                        Storyboard.TargetProperty="Opacity"
                        From="0.0" To="1.0" Duration="0:0:15"/>
                          <DoubleAnimation
                        Storyboard.TargetName="linia3"
                        Storyboard.TargetProperty="Opacity"
                        From="0.0" To="1.0" Duration="0:0:20"/>
                          <DoubleAnimation
                        Storyboard.TargetName="linia4"
                        Storyboard.TargetProperty="Opacity"
                        From="0.0" To="1.0" Duration="0:0:25"/>
                          <DoubleAnimation
                        Storyboard.TargetName="linia5"
                        Storyboard.TargetProperty="Opacity"
                        From="0.0" To="1.0" Duration="0:0:30"/>
                </Storyboard>
            </StackPanel.Resources>

            <Button Content="Click" Height="42" Name="button12" Width="53" Click="button12_Click" />
            <TextBox TextWrapping="Wrap" Text="TextBox"/>
        </StackPanel>
    </Grid>

 


Parvez Ansari WPF + Silverlight 4.0 Themes www.nukeation.com Blog : www.wpfblogger.com

Viewing all articles
Browse latest Browse all 14

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>