title: Unable to find TargetElement of a Storyboard
body: <p>In my Windows 8.1 Store app I am trying to move 2 UI elements horizontally by defining translate transforms for them and then animating the transforms. Below is the simplified XAML for my scenario:</p>
  
  <p><strong>MyUserControl.Xaml</strong></p>
  
  <pre><code>    &lt;UserControl
          x:Class="AnimTest.UserControls.MyUserControl"
          xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
          xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"&gt;
          &lt;Grid Background="BlueViolet"/&gt;
      &lt;/UserControl&gt;
  </code></pre>
  
  <p><strong>MainPage.Xaml</strong></p>
  
  <pre><code>    &lt;Page
          x:Class="AnimTest.MainPage"
          xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
          xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
          xmlns:userControls="using:AnimTest.UserControls"&gt;
  
          &lt;Grid x:Name="RootGrid"&gt;
              &lt;Grid.RowDefinitions&gt;
                  &lt;RowDefinition Height="*" /&gt;
                  &lt;RowDefinition Height="Auto"/&gt;
              &lt;/Grid.RowDefinitions&gt;
  
              &lt;Grid.Resources&gt;
                  &lt;Storyboard x:Name="MoveContentGrid"&gt;
                      &lt;DoubleAnimation Storyboard.TargetName="ContentGridTransform"
                                       Storyboard.TargetProperty="X"
                                       By="250"
                                       Duration="0:0:0.2"
                                       EnableDependentAnimation="True"/&gt;
                  &lt;/Storyboard&gt;
                  &lt;Storyboard x:Name="MoveMyUserControl"&gt;
                      &lt;DoubleAnimation Storyboard.TargetName="MyUserControlTransform"
                                       Storyboard.TargetProperty="X"
                                       By="250"
                                       Duration="0:0:0.2"
                                       EnableDependentAnimation="True"/&gt;
                  &lt;/Storyboard&gt;
              &lt;/Grid.Resources&gt;
  
              &lt;Grid Grid.Row="0" Background="Blue"&gt;
                  &lt;Grid.RenderTransform&gt;
                      &lt;TranslateTransform x:Name="ContentGridTransform" /&gt;
                  &lt;/Grid.RenderTransform&gt;
              &lt;/Grid&gt;
  
              &lt;userControls:MyUserControl Width="250" HorizontalAlignment="Left" Grid.Row="0"&gt;
                  &lt;userControls:MyUserControl.RenderTransform&gt;
                      &lt;TranslateTransform x:Name="MyUserControlTransform" X="-250" /&gt;
                  &lt;/userControls:MyUserControl.RenderTransform&gt;
              &lt;/userControls:MyUserControl&gt;
  
              &lt;Button Content="Animate" Grid.Row="1" Click="AnimateButton_OnClick"/&gt;
          &lt;/Grid&gt;
      &lt;/Page&gt;
  </code></pre>
  
  <p><strong>MainPage.Xaml.cs</strong></p>
  
  <pre><code>    using Windows.UI.Xaml;
      using Windows.UI.Xaml.Controls;
  
      namespace AnimTest
      {
          public sealed partial class MainPage : Page
          {
              public MainPage()
              {
                  this.InitializeComponent();
              }
  
              private void AnimateButton_OnClick(object sender, RoutedEventArgs e)
              {
                  MoveContentGrid.Begin();
                  MoveMyUserControl.Begin();
              }
          }
      }
  </code></pre>
  
  <p>when I click on the Animate button, I get the following exception:</p>
  
  <blockquote>
    <p>System.Exception: No installed components were detected.</p>
    
    <p>Cannot resolve TargetName MyUserControlTransform.    at
    Windows.UI.Xaml.Media.Animation.Storyboard.Begin()    at
    AnimTest.MainPage.AnimateButton_OnClick(Object sender, RoutedEventArgs
    e)</p>
  </blockquote>
  
  <p>But if I comment out <em>MoveMyUserControl.Begin();</em> from the code behind, then the call to <em>MoveContentGrid.Begin();</em> works just fine and that storyboard begins its animation.</p>
  
  <p>Any idea why the second call causes this exception and how to get this to work?</p>