Wednesday, October 21, 2009

What is the difference between Title and WindowTitle properties in a Xaml Browser application?


In a Xaml browser application (XBAP) as a page's properties you can set a TITLE as well as a WindowTitle property.
----------------------------------------
The Page.Title property is defined as in the following:
----------------------------------------------------------------
public string Title { set; get; }
    Member of System.Windows.Controls.Page

Summary:
Gets or sets the title of the System.Windows.Controls.Page. This is a dependency property.

Returns:
The title of the System.Windows.Controls.Page.

---------------------------------------------
Whereas the WindowTitle is defined as in the following:
-------------------------------------------
public string WindowTitle { set; get; }
 Member of System.Windows.Controls.Page

Summary:
Gets or sets the title of the host System.Windows.Window or System.Windows.Navigation.NavigationWindow of a System.Windows.Controls.Page.

Returns:
The title of a window that directly hosts the System.Windows.Controls.Page.
==================
What is observed when you bring up  this page shown here is
-----------

    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
   Title="Pagex"
      Background="Azure"
      WindowTitle="What is this?"
      >
  
Hello, XAML Browser App

-----------------------
displayed here.














As you can see Title property is not displayed where as the Window that gets displayed, the browser window shows this title. If you remove the WindowTitle property what is displayed is shown here,