Click to Rate and Give Feedback
MSDN
MSDN Library
Web Development
Silverlight
Silverlight 2
Content Class
Content Properties
 IsFullScreen Property

  Switch on low bandwidth view
.NET Framework Class Library for Silverlight
Content..::.IsFullScreen Property

Gets or sets a value that indicates whether the Silverlight plug-in is displaying in full-screen mode.

Namespace:  System.Windows.Interop
Assembly:  System.Windows (in System.Windows.dll)
Visual Basic (Declaration)
Public Property IsFullScreen As Boolean
    Get
    Set
Visual Basic (Usage)
Dim instance As Content
Dim value As Boolean

value = instance.IsFullScreen

instance.IsFullScreen = value
C#
public bool IsFullScreen { get; set; }

Property Value

Type: System..::.Boolean
true if the Silverlight plug-in displays as a full-screen plug-in. false if the Silverlight plug-in displays as an embedded plug-in.

You cannot set this property during instantiation. Typically you would switch to full-screen only as a user-initiated action and therefore you would set full-screen to true as part of a mouse or keyboard event handler.

A Silverlight plug-in can display in either embedded mode or full-screen mode:

  • In embedded mode, the plug-in displays within the Web browser.

  • In full-screen mode, the plug-in resizes to the current resolution of the screen and displays on top of all other applications.

For more information, see Full-Screen Support.

The FullScreenChanged event occurs whenever the IsFullScreen property changes. Full-screen mode also influences ActualHeight and ActualWidth.

NoteNote:

Performance Note: For best performance, when your application goes into full screen, hide or disconnect from the tree all of the objects that are not being rendered in full-screen mode. You can hide an object by setting its Visibility property to Collapsed.

The following code example demonstrates how to use this property.

Visual Basic
Private WithEvents rootPage As Page = New Page()
Private WithEvents htmlContent As Content
Private Sub Application_Startup(ByVal o As Object, ByVal e As StartupEventArgs) Handles Me.Startup
    Me.RootVisual = rootPage
    htmlContent = Me.Host.Content
End Sub

Private Sub ToggleFullScreen(ByVal sender As Object, _
    ByVal e As MouseButtonEventArgs) Handles rootPage.MouseLeftButtonDown
    Me.Host.Content.IsFullScreen = Not Me.Host.Content.IsFullScreen
End Sub

Private Sub DisplaySizeInformation( _
    ByVal sender As Object, ByVal e As EventArgs) _
    Handles htmlContent.FullScreenChanged, htmlContent.Resized

    Dim message As String = String.Format( _
        "ActualWidth={0}, ActualHeight={1}", _
        Me.Host.Content.ActualWidth, _
        Me.Host.Content.ActualHeight)

    rootPage.LayoutRoot.Children.Clear()
    Dim t As New TextBlock()
    t.Text = message
    rootPage.LayoutRoot.Children.Add(t)

End Sub

C#
Page rootPage = new Page();
private void Application_Startup(object sender, StartupEventArgs e)
{
    this.RootVisual = rootPage;

    rootPage.LayoutRoot.MouseLeftButtonDown +=
        delegate(Object s, MouseButtonEventArgs args) {
            this.Host.Content.IsFullScreen =
                !this.Host.Content.IsFullScreen;
        };

    this.Host.Content.FullScreenChanged += 
        new EventHandler(DisplaySizeInformation);

    this.Host.Content.Resized += 
        new EventHandler(DisplaySizeInformation);
}

private void DisplaySizeInformation(Object sender, EventArgs e)
{
    String message = String.Format(
        "ActualWidth={0}, ActualHeight={1}",
        this.Host.Content.ActualWidth,
        this.Host.Content.ActualHeight);

    rootPage.LayoutRoot.Children.Clear();
    rootPage.LayoutRoot.Children.Add(
        new TextBlock { Text = message });
}

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker