title: EventTrigger Not Working When Declared in Window.Resources in WPF
body: <p>I am new to WPF, so I may be missing something essential, but I have experimented and tried to come up with an explanation for the following phenomenon, to no avail.
  Basically, the following code works (displays animation):</p>
  
  <pre><code>    &lt;Window.Resources&gt;
      &lt;Storyboard x:Key="LoadStoryBoard"
  AutoReverse="True"
  RepeatBehavior="Forever"&gt;
          &lt;DoubleAnimationUsingKeyFrames Storyboard.TargetName="button1" 
                  Storyboard.TargetProperty="(Button.Opacity)"&gt;
              &lt;EasingDoubleKeyFrame KeyTime="0:0:0.7" Value="0.4" /&gt;
          &lt;/DoubleAnimationUsingKeyFrames&gt;
      &lt;/Storyboard&gt;
  &lt;/Window.Resources&gt;
  ...
  &lt;Button x:Name="button1" Grid.Column="0" Grid.Row="1" Style="{StaticResource Load}"&gt;
  &lt;Button.Triggers&gt;
      &lt;EventTrigger RoutedEvent="Loaded"&gt;
                  &lt;BeginStoryboard Storyboard="{StaticResource LoadStoryBoard}" /&gt;
              &lt;/EventTrigger&gt;
  &lt;/Button.Triggers&gt;
  &lt;/Button&gt;
  </code></pre>
  
  <p>However, when I try to put the eventrigger in the Load Style in the following, the animation ceases to appear:</p>
  
  <pre><code>    &lt;Window.Resources&gt;
      &lt;Storyboard x:Key="LoadStoryBoard"
  AutoReverse="True"
  RepeatBehavior="Forever"&gt;
          &lt;DoubleAnimationUsingKeyFrames Storyboard.TargetName="button1" 
                  Storyboard.TargetProperty="(Button.Opacity)"&gt;
              &lt;EasingDoubleKeyFrame KeyTime="0:0:0.7" Value="0.4" /&gt;
          &lt;/DoubleAnimationUsingKeyFrames&gt;
      &lt;/Storyboard&gt;
  &lt;/Window.Resources&gt;
  ...
  &lt;Style x:Key="Load" TargetType="Button"&gt;
  ...
  &lt;Style.Triggers&gt;
      ...
      &lt;EventTrigger RoutedEvent="Loaded"&gt;
                  &lt;BeginStoryboard Storyboard="{StaticResource LoadStoryBoard}" /&gt;
              &lt;/EventTrigger&gt;
  &lt;/Style.Triggers&gt;
  &lt;/Style&gt;
  </code></pre>