Someone recently asked me for advice on how to bind the visual state of a Silverlight control to a property of the view-model. Specifically, they had a Boolean property on their view-model named something like IsExpanded that they wanted to control the expanding and collapsing of a control in the view with the value of this view-model property.
It was such a fun sounding challenge—and one that seemed like it would be very useful to have for many situations—that I couldn’t resist creating a simple solution.
Here’s What I Created (Silverlight 4 Plug-In Required)
Here’s How I Did It...