MVVM, Animations and Commanding - Best way to kick off animations?


MVVM, Animations and Commanding - Best way to kick off animations?



Users love animations. See the iphone for a good example :) Everything a user does in the iphone kicks off an animation.

Enter MVVM and Commanding (I'm thinking about Silverlight 2 specifically). A user action triggers an event via Commanding, and we're sitting in the ViewModel thinking about how to trigger a nice animation for the user...

There are some possibilities, but I don't find any of them particularly tasteful.

  • A bit of MVP. Have the View implement an interface and then have the VM call a method on the view to start an animation.
  • In Silverlight 3 Actions/Behaviors might be a kind of answer, but I'm trying to figure out the best approach for SL 2.
  • Do hokey animations from the VM where you update (via a timer) binding properties to make things happen... Pretty awkward.

Has anyone had good success with an approach?




Are there any design patterns used in the .NET Framework?

1:



What is Model View Presenter? [closed]
Typically I use events to fire the animations from the viewmodel in Silverlight 2.
PHP Web-App Design


Design Pattern Alternative to Coroutines


80 out of 100 based on 70 user ratings 1070 reviews