How to change the state of a Silverlight control to go to a different VisualState in your VisualStateManager programmatically?
Let's say you have a VisualStateManager in your Style which has TargetType="Button" and defines different VisualStates for different events, i.e. MouseOver, Pressed, Disabled and Normal. They of course work when you mouse hover the button or press it, but if you decided to force the button to change its state from the code here is the code you need:
VisualStateManager.GoToState(_YourButton, "Normal", true);
Posted by Damon Serji on
11. September 2009 13:43 under:
Intermediate