title: Stop wpf Storyboard and hold actual value
body: <p>I have following wpf code</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;Window.Resources&gt;
      &lt;ResourceDictionary&gt;
          &lt;ResourceDictionary.MergedDictionaries&gt;
              &lt;ResourceDictionary&gt;
                  &lt;Image x:Key="MyImage" Source="../Assets/icon.ico"/&gt;
              &lt;/ResourceDictionary&gt;
          &lt;/ResourceDictionary.MergedDictionaries&gt;
  
          &lt;Storyboard x:Key="AkomiLogoAnimation"&gt;
              &lt;DoubleAnimation
                              Storyboard.TargetProperty="(Image.RenderTransform).(RotateTransform.Angle)"
                              By="360"
                              SpeedRatio="0.5"
                              RepeatBehavior="Forever"
                              FillBehavior="Stop"
                              /&gt;
          &lt;/Storyboard&gt;
  
      &lt;/ResourceDictionary&gt;
  &lt;/Window.Resources&gt;
          &lt;TextBox x:Name="txtAuto"/&gt;
  
                  &lt;Image Source="../Assets/icon.ico" Width="20" Height="20" RenderTransformOrigin=".5,.5"&gt;
                  &lt;Image.Resources&gt;
                      &lt;converter:IsNullConverter x:Key="IsNullConverter"/&gt;
                  &lt;/Image.Resources&gt;
                  &lt;Image.RenderTransform&gt;
                  &lt;RotateTransform Angle="0" /&gt;
              &lt;/Image.RenderTransform&gt;
                  &lt;Image.Style&gt;
                      &lt;Style&gt;
                      &lt;Style.Triggers&gt;
                              &lt;DataTrigger Binding="{Binding ElementName=txtAuto, Path=Text, Converter={StaticResource IsNullConverter}, NotifyOnSourceUpdated=True, UpdateSourceTrigger=PropertyChanged}" Value="False"&gt;
                              &lt;DataTrigger.EnterActions&gt;
                                  &lt;BeginStoryboard Name="AkomiRotation" Storyboard="{StaticResource AkomiLogoAnimation}"&gt;
                                  &lt;/BeginStoryboard&gt;
                              &lt;/DataTrigger.EnterActions&gt;
                          &lt;/DataTrigger&gt;
                              &lt;DataTrigger Binding="{Binding  ElementName=txtAuto, Path=Text, Converter={StaticResource IsNullConverter}, NotifyOnSourceUpdated=True, UpdateSourceTrigger=PropertyChanged}" Value="True"&gt;
                                  &lt;DataTrigger.EnterActions&gt;
                                  &lt;StopStoryboard BeginStoryboardName="AkomiRotation" &gt;
                                  &lt;/StopStoryboard&gt;
                              &lt;/DataTrigger.EnterActions&gt;
                          &lt;/DataTrigger&gt;
                      &lt;/Style.Triggers&gt;
                      &lt;/Style&gt;
                  &lt;/Image.Style&gt;
              &lt;/Image&gt;
  </code></pre>
  
  <p>The goal is to rotate the image as soon as some text has been entered. But stopping the storyboard lets the image angle jump into it's initial value. </p>
  
  <p>I tried to add <code>FillBehavior="HoldEnd"</code> to the Storyboard definition, but that doesn't work.</p>
  
  <p>Any suggestions? Maybe I can access the angle-value at the end of the animation anyhow and set this value in <code>RotateTransform</code></p>