title: Stop storyboard at exact keyFrame
body: <p>I made a die for some game I'm making (in c#), it's a usercontrol which uses a storyboard to show several images after each other (like a slideshow) so it looks like a rolling 3D die. The problem is starting and stopping it at a specific keyFrame. It's seems logical to use Pause() and Resume() for this, but I can't figure out how to Pause at an exact keyFrame.</p>
  
  <p>Some people use a seperate dispatcherTimer to do this, but this isn't precise enough to stop it at that exact keyframe. (for example, if you throw 4 it must stop on the 4 image).</p>
  
  <p>So, it would be great if there was some method like this:</p>
  
  <pre><code>TimeSpan keyTime = new TimeSpan(0,0,0,0,750); // 750 miliseconds
  myStoryBoard.ResumeTo(keyTime); // &lt;- doesn't exist as far as I know
  </code></pre>
  
  <p>Here is a snippet from my storyboard in XAML:</p>
  
  <pre><code>&lt;Storyboard x:Key="DieStoryBoard" RepeatBehavior="Forever"&gt;
  
          &lt;ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="image1"&gt;
  
              &lt;DiscreteObjectKeyFrame KeyTime="0"&gt;
                  &lt;DiscreteObjectKeyFrame.Value&gt;
                      &lt;Visibility&gt;Visible&lt;/Visibility&gt;
                  &lt;/DiscreteObjectKeyFrame.Value&gt;
              &lt;/DiscreteObjectKeyFrame&gt;
  
              &lt;DiscreteObjectKeyFrame KeyTime="0:0:0.05"&gt;
                  &lt;DiscreteObjectKeyFrame.Value&gt;
                      &lt;Visibility&gt;Collapsed&lt;/Visibility&gt;
                  &lt;/DiscreteObjectKeyFrame.Value&gt;
              &lt;/DiscreteObjectKeyFrame&gt;
  
          &lt;/ObjectAnimationUsingKeyFrames&gt;
  
  
          &lt;ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="image2"&gt;
  
              &lt;DiscreteObjectKeyFrame KeyTime="0:0:0.05"&gt;
                  &lt;DiscreteObjectKeyFrame.Value&gt;
                      &lt;Visibility&gt;Visible&lt;/Visibility&gt;
                  &lt;/DiscreteObjectKeyFrame.Value&gt;
              &lt;/DiscreteObjectKeyFrame&gt;
  
              &lt;DiscreteObjectKeyFrame KeyTime="0:0:0.10"&gt;
                  &lt;DiscreteObjectKeyFrame.Value&gt;
                      &lt;Visibility&gt;Collapsed&lt;/Visibility&gt;
                  &lt;/DiscreteObjectKeyFrame.Value&gt;
              &lt;/DiscreteObjectKeyFrame&gt;
  
          &lt;/ObjectAnimationUsingKeyFrames&gt;
  
  
          &lt;ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="image3"&gt;
  
              &lt;DiscreteObjectKeyFrame KeyTime="0:0:0.10"&gt;
                  &lt;DiscreteObjectKeyFrame.Value&gt;
                      &lt;Visibility&gt;Visible&lt;/Visibility&gt;
                  &lt;/DiscreteObjectKeyFrame.Value&gt;
              &lt;/DiscreteObjectKeyFrame&gt;
  
              &lt;DiscreteObjectKeyFrame KeyTime="0:0:0.15"&gt;
                  &lt;DiscreteObjectKeyFrame.Value&gt;
                      &lt;Visibility&gt;Collapsed&lt;/Visibility&gt;
                  &lt;/DiscreteObjectKeyFrame.Value&gt;
              &lt;/DiscreteObjectKeyFrame&gt;
  
          &lt;/ObjectAnimationUsingKeyFrames&gt;
  .....
  </code></pre>
  
  <p>And some images to make things clearer:</p>
  
  <p><img src="https://i.stack.imgur.com/1w8wJ.png" alt="1"><img src="https://i.stack.imgur.com/bqaIw.png" alt="2"><img src="https://i.stack.imgur.com/SuIc1.png" alt="3"><img src="https://i.stack.imgur.com/bPPi6.png" alt="4"></p>