#100 – Loose XAML Files

A loose XAML file is a file containing XAML that has no associated code-behind and is not compiled into an application.  A loose XAML file can be loaded into Internet Explorer, where the user interface will be rendered.

Some rules about loose XAML files:

  • The top-level element cannot be a Window, but could be a Page or other GUI element (e.g. StackPanel).
  • The top-level element must have any required namespaces defined
  • The top-level element cannot have a x:Class attribute
  • No elements in the file can have event handlers
  • The only browser supported is Internet Explorer (Firefox can render loose XAML with WPF plug-in)
Advertisement