title: WPF animating a StackPanel's width from 0 to Auto?
body: <p>I am trying to animate a StackPanel when its visibility changed to grow from a width of 0 to its automatic width, here is what I have at the moment:</p>
  
  <pre><code>&lt;Trigger Property="Visibility" Value="Visible"&gt;
      &lt;Setter Property="Width" Value="0"&gt;&lt;/Setter&gt;
      &lt;Trigger.EnterActions&gt;
          &lt;BeginStoryboard&gt;
              &lt;Storyboard&gt;
                  &lt;ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Width" Duration="0:0:1"&gt;
                      &lt;DiscreteObjectKeyFrame KeyTime="0"&gt;
                          &lt;DiscreteObjectKeyFrame.Value&gt;
                              &lt;System:Double&gt;NaN&lt;/System:Double&gt;
                          &lt;/DiscreteObjectKeyFrame.Value&gt;
                      &lt;/DiscreteObjectKeyFrame&gt;
                  &lt;/ObjectAnimationUsingKeyFrames&gt;
              &lt;/Storyboard&gt;
          &lt;/BeginStoryboard&gt;
      &lt;/Trigger.EnterActions&gt;
  &lt;/Trigger&gt;
  </code></pre>
  
  <p>Can someone explain how I might achieve this animation? Is it maybe not possible in the way I am trying to do it?</p>
  
  <p>Thanks,
  alex.</p>