Full Screen View For Media Element In WPF


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.

Crating WPF Application Project

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

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 Control’s 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.

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.

Above timer will be similar to System’s DoubleClickTime.

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.

In Full Screen View:

Hope this article helps. J