Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

20.5. Video

To play video in WPF, you use the MediaElement class, just as you did to play sounds. Just as with sounds, you can control the video from the code-behind, using with the class's methods, or you can use EventTriggers to manipulate a Storyboard.

For example, the following markup creates the UI for a simple video viewer that plays a video named Bear.wmv. It can play, stop, and pause the video. There are several important things to notice about the markup:


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint