.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

WPF Animations

Posted By: Syed Shakeer Hussain     Posted Date: January 16, 2011    Points: 2   Category :WPF
WPF is a new framework that has many advanced capabilities. Animations are one of those capabilities, where an object can be animated via rotating, stretching, scaling, moving it across the screen, changing its color, etc. This article will show some of the basic animations.

View Complete Post

More Related Resource Links

Silverlight: Create Animations with XAML and Expression Blend


In this excerpt from his upcoming book, Laurence Moroney explains the basics of Silverlight animation and the animation tools available in Expression Blend.

Lawrence Moroney

MSDN Magazine August 2008

Silverlight: Building Advanced 3D Animations with Silverlight 2.0


Animating with Silverlight is easier than you think. Here we create a 3D app that folds a polyhedron using XAML, C#, and by emulating the DirectX math libraries.

Declan Brennan

MSDN Magazine April 2008

Mix'n'Match Animations

Hi, I have a storyboard written in C# (not XAML) which I use to manipulate some WPF controls - this works fine. But, I wish to manipulate objects in a ViewPort3D using the same storyboard just so all my transitions are contained in a single object. Unfortunately, I have not been able to pull this one off and rather than adding the animation to the storyboard, I have to call BeginAnimation() on the 3D component I want to animate seperately since it doesn't animate when I keep the animations together... not ideal . Is there any reason why I can't do this - storyboards written in XAML seem to pull this one of fine but C# is another story This is what I do but I want to put it in a storyboard, and yes I use the Storyboard.SetValue() for the Target and TargetProperty values. var moveCameraPositionAnimation = new Point3DAnimation() { From = new Point3D(0, 0, 0.5), To = new Point3D(0, 0, 1.2), AutoReverse = true, Duration = TimeSpan.FromMilliseconds(500) }; _focusedViewPort.Camera.BeginAnimation(ProjectionCamera.PositionProperty, moveCameraPositionAnimation); Cheers!

Unusually smooth lag occurring during WPF animations

My problem is simple and can be illustrated in 5 minutes (probably less if you frequently use WPF) of coding:  Create a WPF window (3.0/3.5/maybe 4.0).  Put a grid on it, and put a rectangle in the grid.  Implement code to make one of the rectangles follow the mouse cursor on the (window's or grid's) MouseMove event by setting the rectangle's Margin or RenderTransform.  Everything looks nice when it runs. Now add a second object to the grid that can animate (either another rectangle, or even a button that uses the aero theme because the blue glowing is handled through animations).  Do something so that the second object animates continuously.  Now run it again.  The first rectangle lags the mouse cursor by a substantial amount when the animation is occurring.  If the animation lasts for a short amount of time (< 500ms), then the lag stops immediately after the animation ends.  If the animation lasts for a long time, then there is a delay between when the animation stopped and when the lag stopped.  Sometimes this extra delay lasts for a very long time (> 10 sec). I have asked people more knowlegable than myself, and I have spent a lot of time on google looking for information.  I want to know if anyone can explain these effects.  An easy fix would be to not use animations where this would be a problem, but

Consequative Animations In Storyboard

I want to make animations in storyboard consequative, not parallel so that one starts after the other ends. I will then change duratins of individual animations so using Begin attribute is not an option..NET guy

Jerky animations caused by closing windows


I've got an animation running on the main window (only window) of my WPF application. The problem is that this animation isn't running smoothly.

This animation was constructed in a separate, empty project and worked perfectly (nice and smooth) until I transferred it to my main application. Now you're probably thinking what is the application doing that is interrupting the dispatcher and slowing down the rendering of the animation?

Turns out that the application isn't doing anything. Through a process of elimination (commenting out large chunks of code) I've narrowed the problem down to the creation of my splashscreen. Seems that if I create a window (the splashscreen is a normal WPF window), display it for a couple of seconds, close it and then display my main window, the animation on the main window is jerky. If I take the splashscreen out of the equation the animation is rendered smoothly.

So, why does opening and closing another window before showing my main window cause the main windows animation to shudder?

I've reproduced the problem in a small demo that can be downloaded here 

Embedding Flash animations in a Asp.net Page...


Hi...I just wanted to insert flash animations into a page using Asp.net....

For ex. Like this website....http://axaratech.com/

Kindly advise me the simplest technique for enbedding flash in to asp.net page.

And on clicking a that particular flash , it should be redirected to another suitable page....


Thanks in advance......

Animations - More than one target


Hey guys,

i tried to migrate a website to asp.net. For this old website i used animations with php and jquery.
Now i tried to do everything of this animations with the ajax control kit but i have no clue how.

Imagine i have a div-container ("ContentBox") in which is a div container with the navigation ("Nav") and one with the content ("Content").  Further the ContentBox has a background image.

What i have done on the old page was to fade out the Content-container, changed the color of ContentBox to black (to change the image without coverage) and fade back in the image and the new content. Everything of this happens onClick on a link in the Nav-Container.

Is this possible in asp.net?
1 OnClick-Event but a few divs to be affected?

Thanks a lot.


How to add animations as attached properties for a Window??


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media.Animation;

public class MyClass : DependencyObject
 private static System.Windows.Media.Animation.Storyboard FadeIn;
    static MyClass()
      //Initializing the Fade in storyboard
      FadeIn = new System.Windows.Media.Animation.Storyboard();
      DoubleAnimation fadeinAnim = new DoubleAnimation();
      fadeinAnim.BeginTime = TimeSpan.FromMilliseconds(1);
      fadeinAnim.Duration = TimeSpan.FromMilliseconds(50);

UI Frontiers: Lissajous Animations in Silverlight


The pattern created by the interaction of two sine waves is a Lissajous curve - you've probably seen one on an oscilloscope. We'll show you how to make one in Silverlight for the Web or Windows Phone 7.

Charles Petzold

MSDN Magazine April 2011

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend