Click here to Skip to main content
15,894,106 members
Articles / Programming Languages / C#

Animation in Silverlight

Rate me:
Please Sign up or sign in to vote.
4.91/5 (17 votes)
9 Jun 2010CPOL14 min read 94.6K   3.3K   38  
In this chapter, you will be learning the fundamental concepts of Animations in Silverlight Application, which includes Animation Types, namespace details, classes, objects used, implementation of different types of animations with XAML and with C# code ...
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProductVersion>9.0.30729</ProductVersion>
    <SchemaVersion>2.0</SchemaVersion>
    <ProjectGuid>{B788B50F-653A-42F2-96D6-81D79D1835D7}</ProjectGuid>
    <ProjectTypeGuids>{A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
    <OutputType>Library</OutputType>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <RootNamespace>AnimationSampleCode</RootNamespace>
    <AssemblyName>AnimationSampleCode</AssemblyName>
    <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
    <SilverlightApplication>true</SilverlightApplication>
    <SupportedCultures>en-US</SupportedCultures>
    <XapOutputs>true</XapOutputs>
    <GenerateSilverlightManifest>true</GenerateSilverlightManifest>
    <XapFilename>AnimationSampleCode.xap</XapFilename>
    <SilverlightManifestTemplate>Properties\AppManifest.xml</SilverlightManifestTemplate>
    <SilverlightAppEntry>AnimationSampleCode.App</SilverlightAppEntry>
    <TestPageFileName>TestPage.html</TestPageFileName>
    <CreateTestPage>true</CreateTestPage>
    <ValidateXaml>true</ValidateXaml>
    <EnableOutOfBrowser>true</EnableOutOfBrowser>
    <OutOfBrowserSettingsFile>Properties\OutOfBrowserSettings.xml</OutOfBrowserSettingsFile>
    <UsePlatformExtensions>false</UsePlatformExtensions>
    <ThrowErrorsInValidation>true</ThrowErrorsInValidation>
    <LinkedServerProject>..\AnimationSampleCode.Web\AnimationSampleCode.Web.csproj</LinkedServerProject>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>Bin\Debug</OutputPath>
    <DefineConstants>DEBUG;TRACE;SILVERLIGHT</DefineConstants>
    <NoStdLib>true</NoStdLib>
    <NoConfig>true</NoConfig>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <DebugType>pdbonly</DebugType>
    <Optimize>true</Optimize>
    <OutputPath>Bin\Release</OutputPath>
    <DefineConstants>TRACE;SILVERLIGHT</DefineConstants>
    <NoStdLib>true</NoStdLib>
    <NoConfig>true</NoConfig>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="ActivityControl, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
      <HintPath>Libs\ActivityControl.dll</HintPath>
    </Reference>
    <Reference Include="System.ComponentModel.DataAnnotations" />
    <Reference Include="System.Runtime.Serialization" />
    <Reference Include="System.Windows" />
    <Reference Include="mscorlib" />
    <Reference Include="system" />
    <Reference Include="System.Core" />
    <Reference Include="System.Net" />
    <Reference Include="System.ServiceModel" />
    <Reference Include="System.Windows.Controls.Data.DataForm.Toolkit, Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
      <HintPath>Libs\System.Windows.Controls.Data.DataForm.Toolkit.dll</HintPath>
    </Reference>
    <Reference Include="System.Windows.Controls.Data.Input" />
    <Reference Include="System.Windows.Ria" />
    <Reference Include="System.Xml" />
    <Reference Include="System.Windows.Browser" />
    <Reference Include="System.Windows.Controls" />
    <Reference Include="System.Windows.Controls.Navigation" />
  </ItemGroup>
  <ItemGroup>
    <Compile Include="..\AnimationSampleCode.Web\Resources\ErrorResources.Designer.cs">
      <Link>Web\Resources\ErrorResources.Designer.cs</Link>
      <AutoGen>True</AutoGen>
      <DesignTime>True</DesignTime>
      <DependentUpon>ErrorResources.resx</DependentUpon>
    </Compile>
    <Compile Include="..\AnimationSampleCode.Web\Resources\RegistrationDataResources.Designer.cs">
      <Link>Web\Resources\RegistrationDataResources.Designer.cs</Link>
      <AutoGen>True</AutoGen>
      <DesignTime>True</DesignTime>
      <DependentUpon>RegistrationDataResources.resx</DependentUpon>
    </Compile>
    <Compile Include="AnimationFirstExample.xaml.cs">
      <DependentUpon>AnimationFirstExample.xaml</DependentUpon>
    </Compile>
    <Compile Include="AnimationWithCSharp.xaml.cs">
      <DependentUpon>AnimationWithCSharp.xaml</DependentUpon>
    </Compile>
    <Compile Include="App.xaml.cs">
      <DependentUpon>App.xaml</DependentUpon>
    </Compile>
    <Compile Include="Assets\Resources\ApplicationStrings.Designer.cs">
      <AutoGen>True</AutoGen>
      <DesignTime>True</DesignTime>
      <DependentUpon>ApplicationStrings.resx</DependentUpon>
    </Compile>
    <Compile Include="Models\LoginInfo.cs" />
    <Compile Include="Models\RegistrationDataExtensions.cs" />
    <Compile Include="Controls\CustomDataForm.cs" />
    <Compile Include="Helpers\DataBindingExtensions.cs" />
    <Compile Include="Helpers\DataFieldExtensions.cs" />
    <Compile Include="Helpers\NotOperatorValueConverter.cs" />
    <Compile Include="Helpers\StringFormatValueConverter.cs" />
    <Compile Include="Helpers\TargetNullValueConverter.cs" />
    <Compile Include="Helpers\ResourceWrapper.cs" />
    <Compile Include="Assets\Resources\SecurityQuestions.Designer.cs">
      <AutoGen>True</AutoGen>
      <DesignTime>True</DesignTime>
      <DependentUpon>SecurityQuestions.resx</DependentUpon>
    </Compile>
    <Compile Include="Views\AnimationCodeBehind.xaml.cs">
      <DependentUpon>AnimationCodeBehind.xaml</DependentUpon>
    </Compile>
    <Compile Include="Views\AnimationProperties.xaml.cs">
      <DependentUpon>AnimationProperties.xaml</DependentUpon>
    </Compile>
    <Compile Include="Views\ColorAnimation.xaml.cs">
      <DependentUpon>ColorAnimation.xaml</DependentUpon>
    </Compile>
    <Compile Include="Views\ColorAnimationKeyFrame.xaml.cs">
      <DependentUpon>ColorAnimationKeyFrame.xaml</DependentUpon>
    </Compile>
    <Compile Include="Views\DiscreteKeyFrame.xaml.cs">
      <DependentUpon>DiscreteKeyFrame.xaml</DependentUpon>
    </Compile>
    <Compile Include="Views\DoubleAnimation.xaml.cs">
      <DependentUpon>DoubleAnimation.xaml</DependentUpon>
    </Compile>
    <Compile Include="Views\DoubleAnimationKeyFrame.xaml.cs">
      <DependentUpon>DoubleAnimationKeyFrame.xaml</DependentUpon>
    </Compile>
    <Compile Include="Views\ErrorWindow.xaml.cs">
      <DependentUpon>ErrorWindow.xaml</DependentUpon>
    </Compile>
    <Compile Include="Views\About.xaml.cs">
      <DependentUpon>About.xaml</DependentUpon>
    </Compile>
    <Compile Include="Views\EventTriggerSample.xaml.cs">
      <DependentUpon>EventTriggerSample.xaml</DependentUpon>
    </Compile>
    <Compile Include="Views\Home.xaml.cs">
      <DependentUpon>Home.xaml</DependentUpon>
    </Compile>
    <Compile Include="MainPage.xaml.cs">
      <DependentUpon>MainPage.xaml</DependentUpon>
    </Compile>
    <Compile Include="Properties\AssemblyInfo.cs" />
    <Compile Include="Views\KeyFrameAnimation.xaml.cs">
      <DependentUpon>KeyFrameAnimation.xaml</DependentUpon>
    </Compile>
    <Compile Include="Views\Login\LoginStatus.xaml.cs">
      <DependentUpon>LoginStatus.xaml</DependentUpon>
    </Compile>
    <Compile Include="Views\Login\LoginForm.xaml.cs">
      <DependentUpon>LoginForm.xaml</DependentUpon>
    </Compile>
    <Compile Include="Views\Login\LoginRegistrationWindow.xaml.cs">
      <DependentUpon>LoginRegistrationWindow.xaml</DependentUpon>
    </Compile>
    <Compile Include="Views\Login\RegistrationForm.xaml.cs">
      <DependentUpon>RegistrationForm.xaml</DependentUpon>
    </Compile>
    <Compile Include="Views\PointAnimation.xaml.cs">
      <DependentUpon>PointAnimation.xaml</DependentUpon>
    </Compile>
    <Compile Include="Views\PointAnimationKeyFrame.xaml.cs">
      <DependentUpon>PointAnimationKeyFrame.xaml</DependentUpon>
    </Compile>
    <Compile Include="Views\RectangleAnimation.xaml.cs">
      <DependentUpon>RectangleAnimation.xaml</DependentUpon>
    </Compile>
    <Compile Include="Views\SplineAnimation.xaml.cs">
      <DependentUpon>SplineAnimation.xaml</DependentUpon>
    </Compile>
    <Compile Include="Views\StoryboardMethods.xaml.cs">
      <DependentUpon>StoryboardMethods.xaml</DependentUpon>
    </Compile>
  </ItemGroup>
  <ItemGroup>
    <ApplicationDefinition Include="App.xaml">
      <Generator>MSBuild:MarkupCompilePass1</Generator>
      <SubType>Designer</SubType>
    </ApplicationDefinition>
    <Page Include="Assets\Styles.xaml">
      <Generator>MSBuild:MarkupCompilePass1</Generator>
      <SubType>Designer</SubType>
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </Page>
    <Page Include="Views\ErrorWindow.xaml">
      <SubType>Designer</SubType>
      <Generator>MSBuild:MarkupCompilePass1</Generator>
    </Page>
    <Page Include="Views\About.xaml">
      <SubType>Designer</SubType>
      <Generator>MSBuild:MarkupCompilePass1</Generator>
    </Page>
    <Page Include="Views\Home.xaml">
      <SubType>Designer</SubType>
      <Generator>MSBuild:MarkupCompilePass1</Generator>
    </Page>
    <Page Include="MainPage.xaml">
      <Generator>MSBuild:MarkupCompilePass1</Generator>
      <SubType>Designer</SubType>
    </Page>
    <Page Include="Views\Login\LoginStatus.xaml">
      <Generator>MSBuild:MarkupCompilePass1</Generator>
      <SubType>Designer</SubType>
    </Page>
    <Page Include="Views\Login\LoginForm.xaml">
      <SubType>Designer</SubType>
      <Generator>MSBuild:MarkupCompilePass1</Generator>
    </Page>
    <Page Include="Views\Login\LoginRegistrationWindow.xaml">
      <Generator>MSBuild:MarkupCompilePass1</Generator>
      <SubType>Designer</SubType>
    </Page>
    <Page Include="Views\Login\RegistrationForm.xaml">
      <SubType>Designer</SubType>
      <Generator>MSBuild:MarkupCompilePass1</Generator>
    </Page>
  </ItemGroup>
  <ItemGroup>
    <None Include="Properties\AppManifest.xml" />
  </ItemGroup>
  <ItemGroup>
    <None Include="Libs\ActivityControl.dll" />
    <None Include="Libs\System.Windows.Controls.Data.DataForm.Toolkit.dll" />
  </ItemGroup>
  <ItemGroup>
    <EmbeddedResource Include="..\AnimationSampleCode.Web\Resources\ErrorResources.resx">
      <Link>Web\Resources\ErrorResources.resx</Link>
      <Generator>PublicResXFileCodeGenerator</Generator>
      <LastGenOutput>ErrorResources.Designer.cs</LastGenOutput>
    </EmbeddedResource>
    <EmbeddedResource Include="..\AnimationSampleCode.Web\Resources\RegistrationDataResources.resx">
      <Link>Web\Resources\RegistrationDataResources.resx</Link>
      <Generator>PublicResXFileCodeGenerator</Generator>
      <LastGenOutput>RegistrationDataResources.Designer.cs</LastGenOutput>
    </EmbeddedResource>
    <EmbeddedResource Include="Assets\Resources\ApplicationStrings.resx">
      <Generator>PublicResXFileCodeGenerator</Generator>
      <LastGenOutput>ApplicationStrings.Designer.cs</LastGenOutput>
      <CustomToolNamespace>AnimationSampleCode.Resources</CustomToolNamespace>
    </EmbeddedResource>
    <EmbeddedResource Include="Assets\Resources\SecurityQuestions.resx">
      <Generator>PublicResXFileCodeGenerator</Generator>
      <LastGenOutput>SecurityQuestions.Designer.cs</LastGenOutput>
      <CustomToolNamespace>AnimationSampleCode.Resources</CustomToolNamespace>
    </EmbeddedResource>
  </ItemGroup>
  <ItemGroup>
    <None Include="Properties\OutOfBrowserSettings.xml" />
  </ItemGroup>
  <ItemGroup>
    <Page Include="Views\DoubleAnimation.xaml">
      <SubType>Designer</SubType>
      <Generator>MSBuild:MarkupCompilePass1</Generator>
    </Page>
  </ItemGroup>
  <ItemGroup>
    <Page Include="Views\RectangleAnimation.xaml">
      <SubType>Designer</SubType>
      <Generator>MSBuild:MarkupCompilePass1</Generator>
    </Page>
  </ItemGroup>
  <ItemGroup>
    <Page Include="Views\ColorAnimation.xaml">
      <SubType>Designer</SubType>
      <Generator>MSBuild:MarkupCompilePass1</Generator>
    </Page>
  </ItemGroup>
  <ItemGroup>
    <Page Include="Views\AnimationCodeBehind.xaml">
      <SubType>Designer</SubType>
      <Generator>MSBuild:MarkupCompilePass1</Generator>
    </Page>
  </ItemGroup>
  <ItemGroup>
    <Page Include="AnimationWithCSharp.xaml">
      <SubType>Designer</SubType>
      <Generator>MSBuild:MarkupCompilePass1</Generator>
    </Page>
  </ItemGroup>
  <ItemGroup>
    <Page Include="Views\PointAnimation.xaml">
      <SubType>Designer</SubType>
      <Generator>MSBuild:MarkupCompilePass1</Generator>
    </Page>
  </ItemGroup>
  <ItemGroup>
    <Page Include="Views\AnimationProperties.xaml">
      <SubType>Designer</SubType>
      <Generator>MSBuild:MarkupCompilePass1</Generator>
    </Page>
  </ItemGroup>
  <ItemGroup>
    <Page Include="Views\StoryboardMethods.xaml">
      <SubType>Designer</SubType>
      <Generator>MSBuild:MarkupCompilePass1</Generator>
    </Page>
  </ItemGroup>
  <ItemGroup>
    <Page Include="Views\KeyFrameAnimation.xaml">
      <SubType>Designer</SubType>
      <Generator>MSBuild:MarkupCompilePass1</Generator>
    </Page>
  </ItemGroup>
  <ItemGroup>
    <Page Include="Views\SplineAnimation.xaml">
      <SubType>Designer</SubType>
      <Generator>MSBuild:MarkupCompilePass1</Generator>
    </Page>
  </ItemGroup>
  <ItemGroup>
    <Page Include="Views\ColorAnimationKeyFrame.xaml">
      <SubType>Designer</SubType>
      <Generator>MSBuild:MarkupCompilePass1</Generator>
    </Page>
  </ItemGroup>
  <ItemGroup>
    <Page Include="Views\DiscreteKeyFrame.xaml">
      <SubType>Designer</SubType>
      <Generator>MSBuild:MarkupCompilePass1</Generator>
    </Page>
  </ItemGroup>
  <ItemGroup>
    <Page Include="Views\DoubleAnimationKeyFrame.xaml">
      <SubType>Designer</SubType>
      <Generator>MSBuild:MarkupCompilePass1</Generator>
    </Page>
  </ItemGroup>
  <ItemGroup>
    <Page Include="Views\PointAnimationKeyFrame.xaml">
      <SubType>Designer</SubType>
      <Generator>MSBuild:MarkupCompilePass1</Generator>
    </Page>
  </ItemGroup>
  <ItemGroup>
    <Page Include="Views\EventTriggerSample.xaml">
      <SubType>Designer</SubType>
      <Generator>MSBuild:MarkupCompilePass1</Generator>
    </Page>
  </ItemGroup>
  <ItemGroup>
    <Page Include="AnimationFirstExample.xaml">
      <SubType>Designer</SubType>
      <Generator>MSBuild:MarkupCompilePass1</Generator>
    </Page>
  </ItemGroup>
  <Import Project="$(MSBuildExtensionsPath)\Microsoft\Silverlight\v3.0\Microsoft.Silverlight.CSharp.targets" />
  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
       Other similar extension points exist, see Microsoft.Common.targets.
  <Target Name="BeforeBuild">
  </Target>
  <Target Name="AfterBuild">
  </Target>
  -->
  <ProjectExtensions>
    <VisualStudio>
      <FlavorProperties GUID="{A1591282-1198-4647-A2B1-27E5FF5F6F3B}">
        <SilverlightProjectProperties />
      </FlavorProperties>
    </VisualStudio>
  </ProjectExtensions>
</Project>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



Comments and Discussions