Results 1 to 9 of 9

Thread: How NOT to do animation in WPF

  1. #1

    Thread Starter
    Pro Grammar chris128's Avatar
    Join Date
    Jun 2007
    Location
    England
    Posts
    7,604

    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 2008
    Location
    Rep of Ireland
    Posts
    1,380

    Re: How NOT to do animation in WPF

    I agree this is terrible!

  3. #3
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    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 (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions 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 i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  4. #4
    Frenzied Member
    Join Date
    Jul 2008
    Location
    Rep of Ireland
    Posts
    1,380

    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
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    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 (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions 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 i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  6. #6
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,344

    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 02:14 AM.
    when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
    If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
    https://get.cryptobrowser.site/30/4111672

  7. #7
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    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 (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions 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 i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  8. #8
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,344

    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.
    when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
    If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
    https://get.cryptobrowser.site/30/4111672

  9. #9

    Thread Starter
    Pro Grammar chris128's Avatar
    Join Date
    Jun 2007
    Location
    England
    Posts
    7,604

    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 10: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
  •  



Click Here to Expand Forum to Full Width