title: Programmatic state changes not working in Silverlight
body: <p>I'm trying to get states to change with the visual state manager through code.</p>
  
  <p>I am using:</p>
  
  <pre><code>Microsoft.Expression.Interactivity.Core.ExtendedVisualStateManager.GoToElementState(this.LayoutRoot, "stateRegistration", true);
  </code></pre>
  
  <p>But it doesn't seem to want to work, I have create an event handler and also a listener but it there's no state changed when using that code.</p>
  
  <p>Can anyone help me out.</p>
  
  <p>XAML CODE (Code Snippet):</p>
  
  <pre><code>&lt;Grid x:Name="LayoutRoot" Width="897" Height="699"&gt;
  &lt;VisualStateManager.VisualStateGroups&gt;
  &lt;VisualState x:Name="stateRegistration"&gt;
                      &lt;Storyboard&gt;
                          &lt;DoubleAnimation Duration="0" To="870" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)" Storyboard.TargetName="RegisterContent" d:IsOptimized="True"/&gt;
                          &lt;DoubleAnimation Duration="0" To="880" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)" Storyboard.TargetName="HomeContent" d:IsOptimized="True"/&gt;
                          &lt;DoubleAnimation Duration="0" To="0" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)" Storyboard.TargetName="btnRegRegister" d:IsOptimized="True"/&gt;
                          &lt;DoubleAnimation Duration="0" To="-10" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)" Storyboard.TargetName="btnRegRegister" d:IsOptimized="True"/&gt;
                      &lt;/Storyboard&gt;
                  &lt;/VisualState&gt;
              &lt;/VisualStateGroup&gt;
          &lt;/VisualStateManager.VisualStateGroups&gt;
  &lt;/Grid&gt;
  </code></pre>
  
  <p>Thanks.</p>