I have an intriguing question. Let's say I want to play an animation or change the visual state etc of my view FROM THE VIEW MODEL. How can I do that? Its for building an MVVM application on windows phone 7.
2 Answers
5
votes
You can also use the MVVM Light Toolkit's Messenger class: your view-model would send messages such as "play animation" and "change visual state" when appropriate, and your view's code-behind would register for these messages and react appropriately when they are sent.
1
votes
What you're looking for are "DataTriggers". This is a pain in the ass for WP7 because you have to rely on buggy 3rd party libraries to get this to work (ex: http://expressionblend.codeplex.com/wikipage?title=Behaviors%20and%20Effects&referringTitle=Documentation abandonware?)
Silverlight 4 has this built in so there is light at the end of the tunnel but it's gonna take a while for WP7.