Keyboard Support in Full Screen Mode in Silverlight 4


Introduction

In Silverlight 4, we have keyboard support. In this article we will explore about it.

Creating Silverlight Project

Fire up Visual Studio 2010 and create a new Silverlight Application Project. Name it as FullScreenSupportSample.

image1.gif

Let's make it as User login screen, so we need a TextBox and a Passwordbox. And have button that would make the Toggle between Fullscreen On/Off.

The following is the design for it.

image1.1.gif

Let's write code for FullScreen on or off.

image2.gif

Let's test the application. Yes, we are able to switch to FullScreen and Normal mode. But still we cannot have the keyboard input in the respective TextBox or PasswordBox.

The keyboard support for FullScreen is only given to Trusted Application. That means the application should run in out-of-browser mode.

Let's do that.

image3.gif

And the settings ofcourse.

image4.gif

As you see in above figure, we need to check the elevated trust when running in outside the browser.

Let's have some message when user logs in.

image5.gif

Now run the application and install the application.

image6.gif

Press install to install the application.

Go to fullscreen mode and you would be able to use the Keyboard inputs.

image7.gif

Hope this article helps.

Up Next
    Ebook Download
    View all
    Learn
    View all