Explain the steps needed to be performed in order to create an animation in XAML

Answer

Animation is performed by using Storyboard.TargetName property. For example, to animate an object, the following are the steps:

- Write <BeginStoryboard> tag.
- Embed <Storyboard> tag
- Write <DoubleAnimationUsingKeyFrames> along with begin time and Storyboard.TargetName, Storyboard.TargetProperty attributes.
- Use <SplineDoubleKeyFrame> tag along with KeyTime and value attributes
- Close all the corresponding tags.

The following is the snippet of XAML file to animate an object
<BeginStoryboard>
        <Storyboard>
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00"
                   Storyboard.TargetName="border" Storyboard.TargetProperty="(Border.Background).
                   (GradientBrush.GradientStops)[0].(GradientStop.Offset)">
            <SplineDoubleKeyFrame KeyTime="00:00:0" Value="0"/>
            <SplineDoubleKeyFrame KeyTime="00:00:1" Value="1"/>
           </DoubleAnimationUsingKeyFrames>
        </Storyboard>
</BeginStoryboard> 

All silverlight Questions

Ask your interview questions on silverlight

Write Your comment or Questions if you want the answers on silverlight from silverlight Experts
Name* :
Email Id* :
Mob no* :
Question
Or
Comment* :
 





Disclimer: PCDS.CO.IN not responsible for any content, information, data or any feature of website. If you are using this website then its your own responsibility to understand the content of the website

--------- Tutorials ---