Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Sorry, but you're doing it wrong. </p> <p>You do get bonus points for being extremely creative and ambitious in your solution. But you've taken the proverbial 5kg hammer down on a thumbtack. </p> <p>The correct solution in this situation is to use Storyboards nested in VSM States. It looks like you essentially have 2 States for your UI: One where some business logic value is true and another state for when it's false. Note that the aforementioned distinction is 100% technology independent. In any technology, whatever it is you're trying to achieve would be considered 2 states for your UI. </p> <p>In Silverlight/WPF, instead of hacking together something that mimics UI states, you could actually create VisualStateManager states. </p> <p><em>Technically</em> it would work in the following way:<br> 1. Your UserControl would have 1 VisualStateGroup that has 2 VisualStates (one for true and another for false).<br> 2. Those VSM states each represent 1 storyboard.<br> 3. That storyboard would change the template or any other properties you feel are appropriate.</p> <p>To learn the basics of VSM I strongly suggest you spend the next 30 minutes watching the following VSM videos: <a href="http://expression.microsoft.com/en-us/cc643423.aspx" rel="nofollow noreferrer">http://expression.microsoft.com/en-us/cc643423.aspx</a> (Under "How Do I?")<br> Seriously, these videos are phenomenally successful in explaining VSM. The one that most pertinent to your dilemma is "Add States to a Control" but I'll suggest you watch all of them. </p> <p>In WPF, you could use the VisualStateManager from the <a href="http://wpf.codeplex.com" rel="nofollow noreferrer">WPF Toolkit</a>. </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload