Ejemplo n.º 1
0
        private void StartPlaying()
        {
            // If already playing, keep playing till PlayAsync completes or is interrupted.
            if (Playback_Player.IsPlaying && PauseButton.IsChecked == false)
            {
                return;
            }

            // Resume playing the animation, if paused.
            if (PauseButton.IsChecked == true)
            {
                PauseButton.IsChecked = false;
            }
            else
            {
                // Play the animation at the currently specified playback rate.
                _ = Playback_Player.PlayAsync(fromProgress: 0, toProgress: 1, looped: false);
            }
        }
Ejemplo n.º 2
0
 private void PauseButton_Unchecked(object sender, RoutedEventArgs e)
 {
     // Resume playing current animation.
     Playback_Player.Resume();
 }
Ejemplo n.º 3
0
 private void StopButton_Click(object sender, RoutedEventArgs e)
 {
     // Stop the animation, which completes PlayAsync and resets to initial frame.
     Playback_Player.Stop();
     PauseButton.IsChecked = false;
 }
Ejemplo n.º 4
0
 private void PauseButton_Checked(object sender, RoutedEventArgs e)
 {
     // Pause the animation, if playing.
     // NOTE: Pausing does not cause PlayAsync to complete.
     Playback_Player.Pause();
 }