Silverlight canvas example:

Silverlight canvas example:

In Silverlight we can do animation using Canvas.Here i'm explain simple example.Just copy paste the following xaml code to your silverlight program,then you can see that scrolling texts.

xaml code:

<Canvas 
   xmlns="http://schemas.microsoft.com/client/2007"
   xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

    <Canvas.Triggers>
       <EventTrigger RoutedEvent="Canvas.Loaded" >
          <BeginStoryboard>
            <Storyboard x:Name="animation" Storyboard.TargetProperty="(Canvas.Left)" RepeatBehavior="Forever">
                <DoubleAnimation Storyboard.TargetName="ScrollingText" From="0" To="-820" Duration="0:0:10"  />
                <DoubleAnimation Storyboard.TargetName="ScrollingText2" From="820" To="0" Duration="0:0:10"  />
             </Storyboard>
          </BeginStoryboard>
       </EventTrigger>
    </Canvas.Triggers>


    <TextBlock x:Name="ScrollingText" FontSize="36" Foreground="Green"  Text="This is a TextBlock scrolling Text" />
    <TextBlock x:Name="ScrollingText2" FontSize="36" Foreground="Green" Text="This is a TextBlock scrolling Text" />
</Canvas>

output:

If you want to Bind DoubleAnimation 'From', 'To' property dynamically:

http://sharepointdeveloperblog.blogspot.in/2013/10/doubleanimation-bind-to-property.html

See the following links for some examples:

Comments

Popular posts from this blog

Upload Single/Multiple file by using the REST API and jQuery SharePoint 2013

Add content type to SharePoint List/Library using REST API

A type named 'SP.Data. could not be resolved by the model error