title: With WPF, how to link an animation with a ContentControl?
body: <p>I don't know how to link successfully a StoryBoard to a TranslateTransform that is part of a ContentControl. I always get the following error when I try to run my StoryBoard:</p>
  
  <blockquote>
    <p>'RenderTransform' property does not point to a DependencyObject in path '(Children).[0].(Content).(0).(1)'.</p>
  </blockquote>
  
  <p>I guess I don't know how to define a TargetProperty properly! I tried many different paths but always failed. Here is a simplified version of my code:</p>
  
  <p>The DataTemplate:</p>
  
  <pre><code>&lt;DataTemplate x:Key="bdAnswer"&gt;
    &lt;Border&gt;
      &lt;Border.RenderTransform&gt;
        &lt;TranslateTransform X="0" Y="0"/&gt;
      &lt;/Border.RenderTransform&gt;
    &lt;/Border&gt;
  &lt;/DataTemplate&gt;
  </code></pre>
  
  <p>The Canvas where the DataTemplate is used:</p>
  
  <pre><code>&lt;Canvas x:Name="cnvGame"&gt;
    &lt;ContentControl ContentTemplate="{StaticResource bdAnswer}" /&gt;
    &lt;ContentControl ContentTemplate="{StaticResource bdAnswer}" /&gt;
  &lt;/Canvas&gt;
  </code></pre>
  
  <p>And my StoryBoard:</p>
  
  <pre><code>&lt;Storyboard x:Key="sbGame"&gt;
    &lt;DoubleAnimationUsingKeyFrames 
       BeginTime="00:00:00" 
       Storyboard.TargetName="cnvGame" 
       Storyboard.TargetProperty="(Children)[0].(Content).(UIElement.RenderTransform).(TranslateTransform.Y)" /&gt;
  &lt;/Storyboard&gt;
  </code></pre>
  
  <p>Many thanks!</p>