Прочетете на английски Редактиране

Споделяне чрез


Page.WindowHeight Property

Definition

Gets or sets the height of the host Window or NavigationWindow of a Page.

C#
public double WindowHeight { get; set; }

Property Value

The height of a window that directly hosts a Page.

Examples

The following example shows how to set the height of a window from a page.

XAML
<Page
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="SetWindowHeightPage"
    WindowHeight="500"
    >
</Page>

Remarks

WindowHeight is only applied when a Page is hosted directly by a window, which includes:

If a Page is hosted by a Frame, setting WindowHeight has no effect, but you can still get the value of WindowHeight.

A Page in an XAML browser application (XBAP) can only use WindowHeight to change the height of the browser; the height cannot be changed by setting Height, MinHeight, or MaxHeight.

For more information about XBAP support, see Frequently asked questions about WPF browser-hosted applications (XBAP).

The minimum height of the Windows Internet Explorer window is 150 pixels. For browser-hosted pages, this means that the value of WindowHeight may not be applied if it would cause the total height of the Internet Explorer window to be less than 150 pixels.

Applies to

Продукт Версии
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10