title: Storyboard animation based on control template's control property
body: <p>This is what I have </p>
  
  <ol>
  <li>A ControlTemplate for a button in my window.resource, having an ellipse with an outerglow (named -- <em>TasksToggleButtonOuterGlowBitmapEffect</em>) and a text</li>
  <li>A button that is using this template</li>
  </ol>
  
  <p>This is what I need</p>
  
  <p><strong>1. A storyboard that operates on the outerglow of the above mentioned ellipse
  2. I shall trigger this storyboard from my codebehind file at any moment</strong></p>
  
  <p>When I tried this with the following snippet, the framework gives me a runtime exception stating that it is not able to find the control, <em>TasksToggleButtonOuterGlowBitmapEffect</em></p>
  
  <pre><code>&lt;Window.Resource&gt;
      &lt;ControlTemplate x:Key="DefaultTasksToggleButtonTemplate" TargetType="ToggleButton"&gt;
          &lt;Grid Margin="2"&gt;
              &lt;Border BorderBrush="White" BorderThickness="2" CornerRadius="20"&gt;
                  &lt;Border.BitmapEffect&gt;
                      &lt;OuterGlowBitmapEffect x:Name="TasksToggleButtonOuterGlowBitmapEffect" GlowColor="LightGray" /&gt;
                  &lt;/Border.BitmapEffect&gt;
              &lt;/Border&gt;
              &lt;Ellipse Fill="Red" Width="20" Height="20" Margin="2" /&gt;
              &lt;ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" /&gt;
          &lt;/Grid&gt;
      &lt;/ControlTemplate&gt;
  
  
      &lt;Storyboard x:Key="GlowStoryboard"&gt;
          &lt;DoubleAnimation Storyboard.TargetName="TasksToggleButtonOuterGlowBitmapEffect" Storyboard.TargetProperty="GlowSize" From="5" To="10" /&gt;
      &lt;/Storyboard&gt;
  
  &lt;/Window.Resources&gt;
  </code></pre>
  
  <p>Update -- I want this to be in the resource so that any button can use it</p>