Wednesday, May 18, 2011

Blend Tip : Name your states in UserControls to not conflict with controls

A wierd thing happened. I made a usercontrol with two states "Normal" and "Enabled". However when I would toggle between them with the visual state manager using :
VisualStateManager(this,"Normal",true)  / VisualStateManager(this,"Enabled",true)
It would not go through the transition.

Renaming the states to be "NotEnabled" / "Enabled" fixed it.
So if your state transitions are not playing OR not toggling you need to Name your states to not conflict with common Silverlight control states.

Also it is good to rename your state group to be more relevant to you.