Question

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?

Was it helpful?

Solution

Typically I use events to fire the animations from the viewmodel in Silverlight 2

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top