How NOT to do animation in WPF
Noticed this tutorial in the VBWire News section of the vbforums site: http://visualbasic.about.com/od/usin.../wpfintro6.htm
and after reading it the first thing I thought was why on earth would you use a timer to animate something in WPF... so I commented on the article and low and behold, a week later this article appears :) http://visualbasic.about.com/b/2009/...-animation.htm
So if anyone was going to follow the first article when trying to animate something in WPF... DONT! :)
Re: How NOT to do animation in WPF
I agree this is terrible!
Re: How NOT to do animation in WPF
Cool, he actually admitted his mistake. :thumb: Chris!
Re: How NOT to do animation in WPF
Ha ha, we should complain more but fair play to the author! Anyone who has the guff to admit there wrong is clearly trying there best!
Re: How NOT to do animation in WPF
I was wrong once :D
I like the animation in SL as its all xaml
Re: How NOT to do animation in WPF
Just a thought but maybe you could post your way of achieving this so that if the article changes again people will know the correct way to do this.
Re: How NOT to do animation in WPF
Maybe he would post a link to your correct technique but I doubt it. Why drive traffic away from their site
Re: How NOT to do animation in WPF
Quote:
Originally Posted by
RobDog888
Maybe he would post a link to your correct technique but I doubt it. Why drive traffic away from their site
That's one reason why I think chris 128 should post his code, etc in this thread Also, it would make the thread appear useful rather than talking about mistake someone wrote in an article.
Re: How NOT to do animation in WPF
Quote:
Originally Posted by
Nightwalker83
That's one reason why I think chris 128 should post his code, etc in this thread Also, it would make the thread appear useful rather than talking about mistake someone wrote in an article.
Well the way I would do it is exactly how he did it in the article that he posted after I pointed out the mistake :) (which I already linked to in my original post but here it is again: http://visualbasic.about.com/od/lear.../wpfintro7.htm )
Here's my slightly slimmed down version anyway:
Code:
Dim myDoubleAnimation As New DoubleAnimation
myDoubleAnimation.To = 0.0
myDoubleAnimation.Duration = New Duration(TimeSpan.FromSeconds(5))
Label1.BeginAnimation(Label.OpacityProperty, myDoubleAnimation)
Note that my example just decreases the label's opacity to 0 over 5 seconds, where as in the other developer's article he uses the AutoReverse and RepeatBehavior properties to make it loop and keep fading the label in and out of visibility