Results 1 to 9 of 9

Thread: How NOT to do animation in WPF

  1. #1
    Pro Grammar chris128's Avatar
    Join Date
    Jun 07
    Location
    England
    Posts
    7,534

    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!
    My free .NET Windows API library (Version 2.2 Released 12/06/2011)

    Blog: cjwdev.wordpress.com
    Web: www.cjwdev.co.uk


  2. #2
    Frenzied Member
    Join Date
    Jul 08
    Location
    Rep of Ireland
    Posts
    1,381

    Re: How NOT to do animation in WPF

    I agree this is terrible!

  3. #3
    Super Moderator RobDog888's Avatar
    Join Date
    Apr 01
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    59,467

    Re: How NOT to do animation in WPF

    Cool, he actually admitted his mistake. Chris!

    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (VBA, VB 6, VB.NET, C#)
    Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Star Wars Gangsta Rap Reps & Rating PostsVS.NET on Vista (New)Multiple .NET Framework Versions (New)Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel Core 2 Extreme Ed., 2 WD Raptor 10K RPM 150 GB HDs RAID 1, 2 GBs DDR2 667 MHz RAM, 3 Viewsonic 17" LCDs, Windows Vista RTM, IE 7, Office 2007

  4. #4
    Frenzied Member
    Join Date
    Jul 08
    Location
    Rep of Ireland
    Posts
    1,381

    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!

  5. #5
    Super Moderator RobDog888's Avatar
    Join Date
    Apr 01
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    59,467

    Re: How NOT to do animation in WPF

    I was wrong once

    I like the animation in SL as its all xaml
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (VBA, VB 6, VB.NET, C#)
    Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Star Wars Gangsta Rap Reps & Rating PostsVS.NET on Vista (New)Multiple .NET Framework Versions (New)Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel Core 2 Extreme Ed., 2 WD Raptor 10K RPM 150 GB HDs RAID 1, 2 GBs DDR2 667 MHz RAM, 3 Viewsonic 17" LCDs, Windows Vista RTM, IE 7, Office 2007

  6. #6
    Web developer Nightwalker83's Avatar
    Join Date
    Dec 01
    Location
    Adelaide, Australia
    Posts
    9,729

    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.
    Last edited by Nightwalker83; Dec 28th, 2009 at 01:14 AM.
    If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
    Please consider giving me some rep points if I help you a lot.
    DON'T BUMP YOUR POSTS!!! Links to my code examples can now be found on my website: My websites
    Please rate my post if you find it helpful!
    Technology is a dangerous thing in the hands of an idiot! I am that idiot.

  7. #7
    Super Moderator RobDog888's Avatar
    Join Date
    Apr 01
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    59,467

    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
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (VBA, VB 6, VB.NET, C#)
    Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Star Wars Gangsta Rap Reps & Rating PostsVS.NET on Vista (New)Multiple .NET Framework Versions (New)Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel Core 2 Extreme Ed., 2 WD Raptor 10K RPM 150 GB HDs RAID 1, 2 GBs DDR2 667 MHz RAM, 3 Viewsonic 17" LCDs, Windows Vista RTM, IE 7, Office 2007

  8. #8
    Web developer Nightwalker83's Avatar
    Join Date
    Dec 01
    Location
    Adelaide, Australia
    Posts
    9,729

    Re: How NOT to do animation in WPF

    Quote Originally Posted by RobDog888 View Post
    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.
    If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
    Please consider giving me some rep points if I help you a lot.
    DON'T BUMP YOUR POSTS!!! Links to my code examples can now be found on my website: My websites
    Please rate my post if you find it helpful!
    Technology is a dangerous thing in the hands of an idiot! I am that idiot.

  9. #9
    Pro Grammar chris128's Avatar
    Join Date
    Jun 07
    Location
    England
    Posts
    7,534

    Re: How NOT to do animation in WPF

    Quote Originally Posted by Nightwalker83 View Post
    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
    Last edited by chris128; Jan 4th, 2010 at 09:20 AM.
    My free .NET Windows API library (Version 2.2 Released 12/06/2011)

    Blog: cjwdev.wordpress.com
    Web: www.cjwdev.co.uk


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •