RewindAndPlay

public static class MediaExtensions 
{
  public static void Rewind(this MediaElement mediaElement) {
  if (mediaElement.CurrentState != MediaElementState.Stopped)
    mediaElement.Stop();
    mediaElement.Position = TimeSpan.Zero;
  }

  public static void RewindAndPlay(this MediaElement mediaElement) 
  {
    mediaElement.Rewind();
    mediaElement.Play();
  }
}
Example:
MediaElementSlideIn.RewindAndPlay();

Description

When a silverlight MediaElement finishes playing, it does not rewind automatically. This extension method sets the MediaElement position at Zero and starts playing.

Details

Double click on the code to select all.

 

;