Recommended

Skip Navigation LinksHome / News / View News

Silverlight 4: Using the VisualStateManager for state animations with MVVM

+ Add to SilverlightShow Favorites
0 comments   /   posted by Silverlight Show on Apr 07, 2010
(0 votes)
In this post Alex van Beek demonstrates how to use the VisualStateManager to start an animation and incorporate it in the MVVM pattern, without keeping a reference from the ViewModel to the View. 

A recurring problem with MVVM is how to incorporate animations in a nice MVVM way. The problem is that StoryBoards need to be started from the view, since they are usually configured in XAML. This means that the ViewModel needs a reference to the view, in order to tell it when the animation should start. Keeping a reference from the ViewModel to the View is obviously “not done” in the MVVM pattern.

Share


Comments

Comments RSS RSS
No comments

Add Comment

 
 

   
  
  
   
Please add 5 and 5 and type the answer here:

Join the free SilverlightShow webinar 'Silverlight's Power Features: Data Binding in Action' on August 19th 2010, 10:00 am PDT.
In this session Gill Cleeren will make with a complete overview of the data binding features Silverlight 4 has to offer. He will discuss how data binding is the enabler for applying the MVVM pattern and commanding, and will end up reviewing Blend's support for data binding, including the use of design-time data. Read more | Register Now (hide this)