title: Trying to animate height but getting error that height is NaN
body: <p>Been trying to create an animation to dynamically adjust height. I found <a href="http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/6e4afffc-72fc-46b0-8f2d-6cd60feda77f" rel="nofollow noreferrer">this info</a> that helped but when I try to use it I get an error: 'System.Windows.Media.Animation.DoubleAnimation' cannot use default destination value of 'NaN'.</p>
  
  <p>If I specify the height I get that error.</p>
  
  <p>Style:</p>
  
  <pre><code>&lt;Style x:Key="bdrSlideIn"
     TargetType="{x:Type Border}"&gt;
          &lt;Style.Resources&gt;
              &lt;Storyboard x:Key="storyBoardIn"&gt;
                  &lt;DoubleAnimation BeginTime="00:00:00"
                                   From="0"
                                   Duration="00:00:00.65"
                                   Storyboard.TargetName="{x:Null}"
                                   Storyboard.TargetProperty="(FrameworkElement.Height)"
                                   DecelerationRatio="1" /&gt;
              &lt;/Storyboard&gt;
  
              &lt;Storyboard x:Key="storyBoardOut"&gt;
                  &lt;DoubleAnimation BeginTime="00:00:00"
                                   To="0"
                                   Duration="00:00:00.65"
                                   Storyboard.TargetName="{x:Null}"
                                   Storyboard.TargetProperty="(FrameworkElement.Height)"
                                   AccelerationRatio="1" /&gt;
              &lt;/Storyboard&gt;
          &lt;/Style.Resources&gt;
  
          &lt;Style.Triggers&gt;
              &lt;DataTrigger Binding="{Binding SearchExecuted}"
                           Value="True"&gt;
                  &lt;DataTrigger.EnterActions&gt;
                      &lt;BeginStoryboard Storyboard="{StaticResource storyBoardIn}"
                                       Name="SlideStoryboard" /&gt;
                  &lt;/DataTrigger.EnterActions&gt;
                  &lt;DataTrigger.ExitActions&gt;
                      &lt;BeginStoryboard Storyboard="{StaticResource storyBoardOut}" /&gt;
                  &lt;/DataTrigger.ExitActions&gt;
              &lt;/DataTrigger&gt;
          &lt;/Style.Triggers&gt;
      &lt;/Style&gt;
  </code></pre>
  
  <p>Border:</p>
  
  <pre><code>&lt;Border VerticalAlignment="Top"
      Style="{StaticResource bdrSlideIn}"&gt;
          &lt;WPFToolKit:DataGrid Name="dgSearchResults"
                               ItemsSource="{Binding SearchResults}"
                               MaxHeight="280"
                               VerticalAlignment="Top"&gt;...
  </code></pre>