#71 – XAML Files Have A Single Root Element

Each XAML file has exactly one root element, the outermost XAML element.  In WPF, the root element is typically one of:

  • <Page> – A page of content that can be hosted in a browser (System.Windows.Controls.Page)
  • <Window> – A WPF window (System.Windows.Window)
  • <Application> – A WPF application (System.Windows.Application)
  • <ResourceDictionary> – A collection of resources (System.Windows.ResourceDictionary)
  • <UserControl> – A user-defined control (System.Windows.Controls.UserControl)

Root elements also typically include attributes that indicate the namespace(s) used to interpret the content of the XAML file.

Advertisement

About Sean
Software developer in the Twin Cities area, passionate about software development and sailing.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: