title: Storyboard not found in name scope of style
body: <p>The problem I'm having is that if I base a style on a second style that contains a storyboard, then  there is an exception in the Trigger.ExitAction.</p>
  
  <ul>
  <li>If I mouse over either of the rectangles in the demo below then the storyboard will run and the rectangles change colour.  </li>
  <li>When the mouse leaves the red rectangle with style='rectStyle' the storyboard is removed.  </li>
  <li><p>When the mouse leaves the blue rectangle (which uses the derived style) I get this exception:</p>
  
  <p><strong>InvalidOperationException:
  'MouseOverStoryboard' name cannot be found in the name scope of 'System.Windows.Style'.</strong></p></li>
  </ul>
  
  <p>So:</p>
  
  <ul>
  <li>Is it valid to have a storyboard in a base style?  </li>
  <li>Is there a more explicit way of referring to the BeginStoryboardName so that this error doesn't occur?</li>
  <li>Any other suggestions?</li>
  </ul>
  
  <p>In the end what I'm trying to achieve re-use a style containing triggers and storyboards in several other styles.</p>
  
  <p>Here's some simple code that demonstrates the problem:</p>
  
  <pre><code>&lt;Grid&gt;
      &lt;Grid.RowDefinitions&gt;
          &lt;RowDefinition/&gt;
          &lt;RowDefinition/&gt;
      &lt;/Grid.RowDefinitions&gt;
  
      &lt;Grid.Resources&gt;
          &lt;Style x:Key="rectStyle" TargetType="{x:Type Rectangle}"&gt;
              &lt;Style.Triggers&gt;
                  &lt;Trigger Property="IsMouseOver" Value="True"&gt;
                      &lt;Trigger.EnterActions&gt;
                          &lt;BeginStoryboard x:Name="MouseOverStoryboard"&gt;
                              &lt;Storyboard&gt;
                                  &lt;ColorAnimation To="PaleGoldenrod" 
                                     Storyboard.TargetProperty="(Fill).(Color)" 
                                     Duration="0:0:1"/&gt;
                              &lt;/Storyboard&gt;
                          &lt;/BeginStoryboard&gt;
                      &lt;/Trigger.EnterActions&gt;
                      &lt;Trigger.ExitActions&gt;
                          &lt;StopStoryboard BeginStoryboardName="MouseOverStoryboard"/&gt;
                      &lt;/Trigger.ExitActions&gt;
                  &lt;/Trigger&gt;
              &lt;/Style.Triggers&gt;
          &lt;/Style&gt;
  
          &lt;Style x:Key="rectStyle2" TargetType="{x:Type Rectangle}" 
                 BasedOn="{StaticResource rectStyle}"/&gt;
      &lt;/Grid.Resources&gt;
  
      &lt;Rectangle Grid.Row="0" Width="100" Height="100" Fill="Red" 
                 Style="{StaticResource rectStyle}" /&gt;
      &lt;Rectangle Grid.Row="1" Width="100" Height="100" Fill="Blue" 
                 Style="{StaticResource rectStyle2}" /&gt;
  &lt;/Grid&gt;
  </code></pre>