Power BI

Content by Charles Sterling

Thumbnails for video in WPF

I received a question:

How do you show thumbnails of the video ahead of time?

Interestingly silverlight if you set the AutoPlay property to “False” it automatically does this for you. 

But in a XBAP or a Windows WPF application you need need to have a trigger to set the movie duration to 1 second to get this functionality  – i have included the XAML to do this below.



WrapPanel >


<EventTrigger RoutedEvent=”MediaElement.Loaded” SourceName=”me1″>


<BeginStoryboard Name= “myBegin”>

<Storyboard SlipBehavior=”Slip”>

<MediaTimeline Source=”c:\movie.wmv” Storyboard.TargetName=”me1″

 BeginTime=”0:0:0″ Duration=”0:0:1″/>






<Button Height=”200″ Width=”200″>

<MediaElement Name=”me1″ Source=”c:\movie.wmv” LoadedBehavior=”Manual”>