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

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...

Comments:

Add a Comment:

simple_captcha.jpg
(human authentication)


Ads

Categories

About

Random foliage

This website is meant to be a reference for ASP Dot Net developers. The entries are a compilation of things I've figured out how to do and that I deem useful to keep of track for future reference. Assumptions: web development with: C Sharp (vb sucks), visual studio 05/08, .net 3.5, meant for programmers. Written by: James Reategui.