此示例演示如何从 Page 设置窗口的高度。
示例
Page 可以通过设置 WindowHeight 来设置承载它的窗口的高度。 使用此属性,无需明确了解承载 Page 的窗口的类型。
![]() |
---|
若要使用 WindowHeight 来设置窗口的高度,Page 必须为窗口的子级。 |
<Page
xmlns="https://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="https://schemas.microsoft.com/winfx/2006/xaml"
Title="SetWindowHeightPage"
WindowHeight="500"
>
</Page>