Files
docs-desktop/dotnet-desktop-guide/framework/wpf/app-development/how-to-set-the-height-of-a-window-from-a-page.md
T
Andy De George da363692ff Initial WPF content migrated (#17)
* Reset branch for WPF changes

* Convert BMP to PNG; fix link-out-of-scope err

* Add snippets for WPF... 6794 files!!!!

* Add missing snippets

* update file updated between migration

* Fix paths to include

* update breadcrumb and toc

* fix index links

* fix index links

* fix index links

* fix markdown
2020-09-04 09:46:28 -07:00

20 lines
1.1 KiB
Markdown

---
title: "How to: Set the Height of a Window from a Page"
ms.date: "03/30/2017"
helpviewer_keywords:
- "windows [WPF], setting height from a page"
- "pages [WPF], setting window height from"
- "height of window [WPF], setting from a page"
ms.assetid: 4e4488ff-ab5c-4ee9-81a4-e1addb55c5cc
---
# How to: Set the Height of a Window from a Page
This example illustrates how to set the height of the window from a <xref:System.Windows.Controls.Page>.
## Example
A <xref:System.Windows.Controls.Page> can set the height of its host window by setting <xref:System.Windows.Controls.Page.WindowHeight%2A>. This property allows the <xref:System.Windows.Controls.Page> to not have explicit knowledge of the type of window that hosts it.
> [!NOTE]
> To set the height of a window using <xref:System.Windows.Controls.Page.WindowHeight%2A>, a <xref:System.Windows.Controls.Page> must be the child of a window.
[!code-xaml[HOWTONavigationSnippets#SetPageWindowHeightXAML](~/samples/snippets/csharp/VS_Snippets_Wpf/HOWTONavigationSnippets/CSharp/SetWindowHeightPage.xaml#setpagewindowheightxaml)]