locked
How to Set GoToStateAction behavior in Blend4 in response to multiple trigger conditions? RRS feed

  • Question

  • With the release of Blend4, I've been modifying some of my projects to implement visual tree changes in a control template via VSM states rather than setter property changes specified in response to control template trigger conditions.  Question - how do I configure the equivalent of "MultiTrigger.Conditions" using VSM and the GoToStateAction behavior?  For example, how would I configure a visual state transition from 'A' to 'B' if Trigger1 *and* Trigger2 conditions are true?

    Friday, May 21, 2010 10:22 PM

All replies

  • Assuming you're not using the term trigger lightly and with full acknowledgement there might be a better way, the only way I can think of off the top of my head is to have trigger1 trigger a SetDataStoreValueAction that sets a property1 to, say, true and to have trigger2 trigger a SetDataStoreValueAction that sets property2 to true and then within your GoToStateAction use the conditionals to test for property1 and property2 equal to true. 

    Would that work for you?  If not, what are you thinking of in terms of triggers?

    Friday, May 21, 2010 10:56 PM
  • Here's an example that may better illustrate my question.  Consider the toggle button component of a combo box visual tree.  Suppose I want to evoke some sort of visual tree change when I mouse over the toggle button.  However, suppose I want this visual response to be one thing when the combo box drop down is open, and another when it is closed.  In other words, suppose I want to configure a visual state change when ComboBox.MouseOver=True *and* ComboBox.ToggleButton.Clicked=True, and something different when ComboBox.MouseOver=True *and* ComboBox.ToggleButton.Clicked=False.  (This might not be the best example in terms of how a combobox actually behaves, but conceptually it illustrates my question).  Is your answer above still the right approach?
    Monday, May 24, 2010 5:37 PM