How to manipulate StateGroup from Javascript


I have some animation described inside StateGroup

<StateGroup ux:Name="state" Transition="Exclusive">
  <State Name="loginButtonState">
  <State Name="signupFormState">

  <State Name="loadingState">

I can change current state like that

    <Set state.Active="signupFormState" />

but how can I do it from javascript? Thank you in advance


Databind the Active property of the stategroup, or call goto() on the state in question, e.g.


Note that you have to use ux:Name for this to work, not Name