.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

Unusually smooth lag occurring during WPF animations

Posted By:      Posted Date: September 10, 2010    Points: 0   Category :WPF
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

View Complete Post

More Related Resource Links

IIS Smooth Streaming: Enhancing Silverlight Video Experiences with Contextual Data


Adaptive streaming addresses the problem of smooth content delivery and decoding. We walk you through the basics of IIS Smooth Streaming and demonstrate how you can manipulate audio, video and caption data in your own Silverlight projects.

Jit Ghosh

MSDN Magazine March 2010

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

How to make expanding/collapsing CollapsiblePanelExtender from code behind smooth and animated


I've got a CollapsiblePanelExtender in place on a panel in test and it works like a champ. (I get excited about the simplest things).  When I click the panel header it expands and collapses with smooth animation, as expected and desired.

But when I change its state via code behind, it seems I am merely changing its state and somehow bypassing the javascript that controls the smooth animation.

My markup is out of the box. I have added code behind and some javascript, but I am missing the connection.  Here is the javascript:

function pageLoad(sender, args)

function smoothAnimation()
    var collPanel = $find("CollapsiblePanelExtender1");
    collPanel._animation._fps = 45;
    collPanel._animation._duration = 0.50;


And here is the code behind:

protected void btnExpand_Click(object sender, EventArgs e)
    this.CollapsiblePanelExtender1.Collapsed = false;
    this.CollapsiblePanelExtender1.ClientState = "false";

protected void btnCollapse_Click(object sender, EventArgs e)
    this.CollapsiblePanelExtender1.Collapsed = true;

Smooth transition between windows.

Hi, I was wondering how to navigate between windows in WPF application. Right now, I use: SomeWindow win = new SomeWindow(); win.Show(); this.Close();   But instead of smoothly navigating from (this) to (win), (this) is closed, and (win) appears with opening animation. How can I achieve direct transition without any windows actually visually closing/opening?  

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!

Can animation extender be used to replicate Twitter's smooth-scrolling, latest-tweet control?

I'm not going for the exact same control, but if I can find a smart way to automatically/smoothly scroll through text from the database on Timer Tick intervals of 5 seconds... then I can use that as a template. My main idea would be to just dynamically create panels with the text inside of them, then dispose of them when they come towards the bottom of the list... but 3 things stop me 1) it would be a lot of work, 2) when the last panel cycles to the bottom of the display area then how do I make it smoothly disappear? 3) What would I use for the display spot?- a Panel won't work because if its contents exceed the set height, it either just expands to fit it or adds scroll bars. I basically want it to have slideshow functionallity how the images smoothly scroll every few seconds (without the scroll bar), and instead of images I want to use text. Any ideas?

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 

urgent ! = axWebBrowser navigate occurring only after main method ends


So here is the problem

background, I am automating a 3rd party website by filling in a form with select boxes automatically, the problem is that this form is server driven so you have to choose option 1, wait get the document again, choose option 2, wait, get the document again etc.

This is what I have done workign with the mshtml library for the axWebBrowser Control


 public void myFireEvent(string currentCB, HTMLSelectElement currElement)


                HTMLDocument myDoc = axWebBrowser1.Document as HTMLDocument;

                string myLink = "javascript:__doPostBack(\'" + currentCB + "\',\'\')";




private void getManufacturer ()


                HTMLDocument doc = axWebBrowser1.Document as HTMLDocument;

                // ************* 1

                // Get the dropdown li

Error occurring when clicking the New button for a custom list


I have a custom list that was created from a list template, when I click the "New" button the following error occurs:

"An unexpected error has occurred"

I tried resetting the site definition of NewForm.aspx to the original but the error still occurs.  This is the only thing I can find in the logs regarding this list:

09/30/2010 09:44:48.62 w3wp.exe (0x07A0)                       0x0660 Windows SharePoint Services   General                       8kh7 High     There is no Web named "/regions/canada/team-site/Lists/Auto Booking Current Quarter/AllItems.aspx".  

09/30/2010 09:44:48.62 w3wp.exe (0x07A0)                       0x0660 Windows SharePoint Services  

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......

Smooth page slide in the form. Please help me!

I cannot organize a smooth page slide in the form (where the current page slides to the left or right to reveal the next page). On the pages PictureBox and TextBox. I tried to do this by SplitContainer, but if you move the mouse, the panel flicker. If the splitter to move 15 times per second with a timer it would be just terrible. I thought it would look better in WPF, but there's no SplitContainer. Tell me, please, how to use the element. I have not written anything for WPF, it is for me a new area. I'm using VS2010, C#. 

Thank you very much!

ListBox / ListView smooth scrolling missing


Why doesn't ListBox implement smooth scrolling?


Seems like pretty silly limitation, considering fancy eye-kandy nature of WPF.

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.


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