Infosys Microsoft Alliance and Solutions blog

« MMIX > MMX - The King is dead; long live the King (Year end musing on IT providers space) | Main | Win 7 - Difference between Touch and Gesture »

VisualStateManager's Benefits

Many months back I had written about VisualStateManager (VSM) feature in Silverlight. Overtime, MS has been working on streamlining this and new additions are available with Blend 3 to support VSM. VSM got introduced in SL, as some say, mostly to address the lack of triggers, due to which creating control templates was a big issue. Eventually WPF 4 will also start to support VSM. There have been many interesting debates on this, which you can find here, here, here and here, but this parts and states model is here to stay.

In case you haven't spent time as yet checking this out, you can find a good intro in the 4 part series by Karen Corby, starting here. Another interesting blog is by Ian Griffiths. Christian Schormann captures the goals for VSM here.

Personally I find VSM useful and in a recent conversation, we were discussing the benefits of VSM. I thought I will capture a few here. 

1. VSM allows logical grouping of states. Looking at the state groups and states within, it is easy to figure out which states are orthogonal and which don't go hand in hand.

2. The capability of control to exist in mutliple states from different VSM state groups is interesting and as it is internally managed, the control writer doesn't has to worry much about this, apart from invoking GoTo actions to transition to specific states.

3. VSM model can not only be applied at custom control but at a page level as well and page states managed via it. I had shown this in my earlier blog.

4. The best part of VSM, i feel is the ability to deactivate a state when animating to another state in the same state group. VSM not only deactivates, but actually plays a suitable reverse animation. Ian explains this in his blog in more detail. I tried to dig deeper into the framework code to see how this is implemented but hit a roadblock as the real implementation is in agcore.dll and that being a native DLL i could not use reflector with it.

You are welcome to add to this list.


Fluid Layouts was another feature added in Blend 3. It helps in creating smoother animations and reduces the design complexities too.

One more benefit I find with VSMs is that they help manage the code well. The orthogonal groupings help in better understanding of the states.

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)

Please key in the two words you see in the box to validate your identity as an authentic user and reduce spam.

Subscribe to this blog's feed

Follow us on

Blogger Profiles

Infosys on Twitter