title: Windows Phone 7 Navigation Animation
body: <p>I'm trying to do an animation when navigating away from a page, but I get this error:</p>
  
  <p>Cannot resolve TargetProperty (UIElement.RenderTransform).(CompositeTransform.TranslateX) on specified object.</p>
  
  <p>I copied the code from a book, and I tested the book's sample code and it works but I can't get it to work on my app. Any ideas? This is my code:</p>
  
  <p>XAML:</p>
  
  <pre><code>&lt;phone:PhoneApplicationPage.Resources&gt;
          &lt;Storyboard x:Name="HidePage" Completed="HidePage_Completed"&gt;
              &lt;DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)" Storyboard.TargetName="phoneApplicationPage"&gt;
                  &lt;EasingDoubleKeyFrame KeyTime="0" Value="0"/&gt;
                  &lt;EasingDoubleKeyFrame KeyTime="0:0:1" Value="-480"/&gt;
              &lt;/DoubleAnimationUsingKeyFrames&gt;
              &lt;DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)" Storyboard.TargetName="phoneApplicationPage"&gt;
                  &lt;EasingDoubleKeyFrame KeyTime="0" Value="0"/&gt;
                  &lt;EasingDoubleKeyFrame KeyTime="0:0:1" Value="-800"/&gt;
              &lt;/DoubleAnimationUsingKeyFrames&gt;
          &lt;/Storyboard&gt;
  &lt;phone:PhoneApplicationPage.Resources&gt;
  </code></pre>
  
  <p>C#</p>
  
  <pre><code>protected override void OnNavigatingFrom(NavigatingCancelEventArgs e)
  {
      base.OnNavigatingFrom(e);
  
      if (this.UriToNavigateTo == null)
      {
          e.Cancel = true;
          UriToNavigateTo = e.Uri;
          this.HidePage.Begin();
      }
      else
      {
          UriToNavigateTo = null;
      }
  }
  </code></pre>
  
  <p>Thanks!</p>