Full Screen View for Media Element in WPF


Introduction

In the previous article about "Seek bar For Media Element in WPF", we saw how to seek the Media Element to the desired position. In this article we will see how we can make the Media Element to run FullScreen.

Creating WPF Application Project

Fire up Visual Studio 2008 and Create a WPF Application and name the project as MediaSampleWPF.

1.gif
 
I am just extending the feature that we experienced in our last application titled "Media Element In WPF", "Screenshot From Media Element in WPF", and "Seek bar For Media For Media Element In WPF".

As in the Timer Controls Tick event we are doing something, let's add a piece of code that would help us making the Media Element Full Screen run properly.

2.gif
 
We will make the MediaElement to show as FullScreen on MouseDoubleClick, but there is a road block for us. We don't have LeftMouseDoubleClick event for MediaElement.

So we will tweak this in following manner, we will take up the System's Double Click Time and use it in our LeftMouseButtonUp event.

3.gif
 
Above timer will be similar to System's DoubleClickTime.

4.gif
 
The above code should work for making the Full Screen view. Let's test it.

Run the application and Double Click on the Media Element. Now you can see the Media Element running in Full Screen Mode.

5.gif
 
In Full Screen View:

6.gif
 
Hope this article helps.

Up Next
    Ebook Download
    View all
    Learn
    View all