Software Architecture-Sliverlight 4.0-New Feature-FullScreenOptions property

Silverlight supports full screen mode. So there are 2 modes, one embedded mode and second full screen mode.
Full screen mode looks like as:

Embeded screen mode looks like as:

Full screen mode support was already there in previous versions of Silverlight. But in Sliverlight 4.0, we have a new feature by FullScreenOptions property.

Lets suppose a sample with following three radio button with xaml as:

First button code use IsFullScreen property to false (default value is false- So it can be avoided for embedded code mode) as:

private void radioButton1_Checked(object sender, RoutedEventArgs e)
        {
            RadioButton rdo = sender as RadioButton;
            if (rdo.IsChecked==true)
            {
                App.Current.Host.Content.IsFullScreen = false;
            }
        }

Second button code set the full screen mode to true. Secondly FullScreenOptions
is set to None-means that full screen mode will not be maintained when screen is not active.[It is default]

private void radioButton2_Checked(object sender, RoutedEventArgs e)
        {
            RadioButton rdo = sender as RadioButton;
            if (rdo.IsChecked == true)
            {
                App.Current.Host.Content.FullScreenOptions = System.Windows.Interop.FullScreenOptions.None; // default value-No need to specify.
                App.Current.Host.Content.IsFullScreen = true;
            }
        }

Thrid button code set full screen mode to true. Secondly, FullScreenOptions is set to StaysFullScreenWhenUnfocused means that full screen mode will be maintained when screen is not active.

private void radioButton3_Checked(object sender, RoutedEventArgs e)
        {
            RadioButton rdo = sender as RadioButton;
            if (rdo.IsChecked == true)
            {
                App.Current.Host.Content.FullScreenOptions = System.Windows.Interop.FullScreenOptions.StaysFullScreenWhenUnfocused;
                App.Current.Host.Content.IsFullScreen = true;
            }
        }

An option to save setting for FullScreenOptions is asked by silverlight as:

You can see the setting info by right clicking the Silverlight page as below:

Limitation of Full screen mode:
1. No Drag-and-drop support
2. No OpenFileDialog and SaveFileDialog dialog boxes support.
3. No Multitouch input support.
4. Most keyboard events are disabled.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: