Beispiel #1
0
 // The event handler, which will listen for MainPage's VideoSelected
 //     event, after being subscribed to it on the MainPage.
 public void VideoSelected(object sender, VideoSelectionArgs e)
 {
     // Get the MediaSource from the event arguments, and set up and start
     //    the media player.
     mediaPlayerElement.MediaPlayer.Source           = e.Source;
     mediaPlayerElement.MediaPlayer.RealTimePlayback = true;
     mediaPlayerElement.MediaPlayer.Play();
 }
 private void RaiseVideoSelectedEvent(MediaSource source)
 {
     // Ensure that something is listening to the event.
     if (this.VideoSelected != null)
     {
         // Create the args, and call the listening event handlers.
         VideoSelectionArgs args = new VideoSelectionArgs(source);
         this.VideoSelected(this, args);
     }
 }