Changing Visual State from Codebehind
Posted on: Thu Jun 19 11:35:32 -0700 2008. Updated on: Sat Jun 21 00:36:53 -0700 2008.
Category: Silverlight
Category: Silverlight
Lets say you want to change the Visual state of a control, for example button1. In the codebehind you would go:
VisualStateManager.GoToState(button1, "MouseOver", true);Notes: You can only set the visual state of a control that is of control type, ie a Button has visual states but a Grid or TextBlock does not. I know that is lame...