Export (0) Print
Expand All

Page.WindowTitle Property

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

Namespace:  System.Windows.Controls
Assembly:  PresentationFramework (in PresentationFramework.dll)
XMLNS for XAML: http://schemas.microsoft.com/winfx/2006/xaml/presentation, http://schemas.microsoft.com/netfx/2007/xaml/presentation

[LocalizabilityAttribute(LocalizationCategory.Title)]
public string WindowTitle { get; set; }
<object WindowTitle="string" .../>

Property Value

Type: System.String
The title of a window that directly hosts the Page.

By default, the title of a window that hosts a page, including NavigationWindow and Windows Internet Explorer, is the name of the file that is currently being hosted (with an .xaml extension if the page is loose Extensible Application Markup Language (XAML), or an .xbap extension if the page is part of an XAML browser application (XBAP)).

A page can change the default by setting its WindowTitle property.

Once a page sets the title of a window in this way, the window's title does not change until another page sets WindowTitle with a different value.

NoteNote

The Page must be the topmost piece of content in a window for WindowTitle to have an effect; if a Page is hosted within a Frame, for example, setting WindowTitle does not change the title of the host window.

WindowTitle can also be used to generate the name of the navigation history entry for a piece of navigated content. The following pieces of data are used to automatically construct a navigation history entry name, in order of precedence:

  • The attached Name attribute.

  • The Title property.

  • The WindowTitle property and the uniform resource identifier (URI) for the current page

  • The uniform resource identifier (URI) for the current page.

If you have associated a CustomContentState object with a piece of content in navigation history, you can specify the name value of a navigation history element by overriding CustomContentState.JournalEntryName.

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

<Page
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Page Title"
    WindowTitle="Window Title"
    >
</Page>

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft