Gets or sets the height of the application window in pixels.
Assembly: System.Windows (in System.Windows.dll)
The application is not running outside the browser.
The current thread is not the user interface (UI) thread.
The specified value when setting this property is greater than the available screen height.
You can set this property only in the following cases:
In response to a user-initiated action, for example, in a button Click event handler.
In a trusted application.
The minimum window height is dictated by the operating system. If you set this property to a value below this minimum, the value is ignored.
The following code example demonstrates the use of this property. In this example, the window position and dimensions were previously saved to the ApplicationSettings in the isolated storage as a user defined key/value pair. These key/value pairs are retrieved and used to set the current value of the window settings.
Private Sub Application_Startup(ByVal o As Object, ByVal e As StartupEventArgs) Handles Me.Startup Me.RootVisual = New MainPage() ' Set the window position and dimensions to the previoius settings. ' The key/value pairs in the ApplicationSettings are user defined. If (Application.Current.IsRunningOutOfBrowser) Then ' Get the application settings from IsolatedStorage. Dim appSettings As IsolatedStorageSettings = IsolatedStorageSettings.ApplicationSettings ' Get a reference to the main window. Dim mainWindow = Application.Current.MainWindow ' Set the Window.Top property. If (appSettings.Contains("WindowTop")) Then mainWindow.Top = Convert.ToDouble(appSettings("WindowTop")) End If ' Set the Window.Left property. If (appSettings.Contains("WindowLeft")) Then mainWindow.Left = Convert.ToDouble(appSettings("WindowLeft")) End If ' Set the Window.Width property. If (appSettings.Contains("WindowWidth")) Then mainWindow.Width = Convert.ToDouble(appSettings("WindowWidth")) End If ' Set the Window.Height property. If (appSettings.Contains("WindowHeight")) Then mainWindow.Height = Convert.ToDouble(appSettings("WindowHeight")) End If End If End Sub
For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.