Content.FullScreenChanged Event
Silverlight
Occurs when the hosted Silverlight plug-in either enters or exits full-screen mode.
Namespace: System.Windows.Interop
Assembly: System.Windows (in System.Windows.dll)
The event does not report the state. When you handle the event, immediately check IsFullScreen.
The following code example demonstrates how to use this event.
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.