title: Accessing parent's namescope from a child
body: <p>In XAML, I have code like this:</p>
  
  <pre><code>&lt;Style TargetType="Button"&gt;
      &lt;Setter Property="Foreground" Value="#c10000" x:Name="TextColor"/&gt;
      &lt;Setter Property="Template"&gt;
          &lt;Setter.Value&gt;
              &lt;ControlTemplate TargetType="Button"&gt;
                  &lt;Border x:Name="RootElement" CornerRadius="8"&gt;
  
                      &lt;VisualStateManager.VisualStateGroups&gt;
                          &lt;VisualStateGroup x:Name="CommonStates"&gt;
  
                              &lt;VisualState x:Name="MouseOver"&gt;
                                  &lt;Storyboard&gt;
                                      &lt;ColorAnimation Storyboard.TargetName="TextColor" 
                                              Storyboard.TargetProperty="Foreground" To="#FF8D00" /&gt;
                                  &lt;/Storyboard&gt;
                              &lt;/VisualState&gt;
                          &lt;/VisualStateGroup&gt;
                      &lt;/VisualStateManager.VisualStateGroups&gt;
                  &lt;/Border&gt;
              &lt;/ControlTemplate&gt;
          &lt;/Setter.Value&gt;
      &lt;/Setter&gt;
  &lt;/Style&gt;
  </code></pre>
  
  <p>This code fails with a message saying that "TextColor" wasn't found in the border's namescope. How do I access the namescope where the TextColor is defined then?
  The ColorAniamtion is supposed to access the setter with the foreground property and change the color.</p>