title: WPF Style Property Trigger not firing on load
body: <p>I have a <code>style trigger</code> on my Buttons <code>IsEnabled</code> property that fires and wiggles my buttons when set to <code>True</code>. This works fine if I disable and then re-enable the button from the code behind (MVVM) once the application has loaded and running. However, the <code>trigger</code> does not fire on initial load. So all my buttons that are enabled by default do not wiggle. What can I do to make the trigger work on load?</p>
  
  <p>Here is my <code>Style</code> from my <code>App.xaml</code></p>
  
  <pre><code>    &lt;Setter Property="RenderTransformOrigin" Value="0.5,0" /&gt;
      &lt;Setter Property="RenderTransform"&gt;
          &lt;Setter.Value&gt;
              &lt;RotateTransform /&gt;
          &lt;/Setter.Value&gt;
      &lt;/Setter&gt;
      &lt;Style TargetType="{x:Type Button}" x:Key="btnDefaultStyle"&gt;
          &lt;Style.Triggers&gt;
              &lt;Trigger Property="IsEnabled" Value="True"&gt;
                  &lt;Trigger.EnterActions&gt;
                      &lt;BeginStoryboard&gt;
                          &lt;Storyboard TargetProperty="RenderTransform.Angle" RepeatBehavior="Forever"&gt;
                              &lt;DoubleAnimation From="0"  To="-5" BeginTime="0:0:0:5.00" Duration="0:0:0.05"/&gt;
                              &lt;DoubleAnimation From="-5" To="0"  BeginTime="0:0:0:5.05" Duration="0:0:0.05"/&gt;
                              &lt;DoubleAnimation From="0"  To="4"  BeginTime="0:0:0:5.10" Duration="0:0:0.05"/&gt;
                              &lt;DoubleAnimation From="4"  To="0"  BeginTime="0:0:0:5.15" Duration="0:0:0.05"/&gt;
                              &lt;DoubleAnimation From="0"  To="-3" BeginTime="0:0:0:5.20" Duration="0:0:0.05"/&gt;
                              &lt;DoubleAnimation From="-3" To="0"  BeginTime="0:0:0:5.25" Duration="0:0:0.05"/&gt;
                              &lt;DoubleAnimation From="0"  To="2"  BeginTime="0:0:0:5.30" Duration="0:0:0.05"/&gt;
                              &lt;DoubleAnimation From="2"  To="0"  BeginTime="0:0:0:5.35" Duration="0:0:0.05"/&gt;
                          &lt;/Storyboard&gt;
                      &lt;/BeginStoryboard&gt;
                  &lt;/Trigger.EnterActions&gt;
                  &lt;Trigger.ExitActions&gt;
                      &lt;BeginStoryboard&gt;
                          &lt;Storyboard TargetProperty="RenderTransform.Angle"&gt;
                              &lt;DoubleAnimation From="0" To="0" BeginTime="0:0:0:0" Duration="0:0:0.0"/&gt;
                          &lt;/Storyboard&gt;
                      &lt;/BeginStoryboard&gt;
                  &lt;/Trigger.ExitActions&gt;
              &lt;/Trigger&gt;
          &lt;/Style.Triggers&gt;
      &lt;/Style&gt;
      &lt;Style TargetType="{x:Type Button}" BasedOn="{StaticResource btnDefaultStyle}" /&gt;
  </code></pre>
  
  <p><code>EventTriggers RoutedEvent</code>, I.e. <code>RoutedEvent="Window.Loaded"</code> is no use as it overrides the Property <code>IsEnable</code> event, and therefore my disabled buttons also wiggle.</p>