Chapter 27. Core XAML


  • XAML syntax

  • Dependency properties

  • Markup extensions

  • Loading XAML dynamically

When writing a .NET application, usually C# is not the only syntax you need to know. If you write Windows Presentation Foundation (WPF) applications, use Windows Workflow Foundation (WF), create XPS documents, or write Silverlight applications, you also need XAML. XAML (eXtensible Application Markup Language) is a declarative XML syntax that's usually needed with these applications.

This chapter gives you more information on the syntax of XAML and extensibility mechanisms that are available with this markup language.


XAML code is declared using textual XML. You can use designers to create XAML code or write XAML code by hand. Visual Studio contains designers to write XAML code for WPF, Silverlight, or WF. Other tools are also available to create XAML such as Microsoft Expression Design and Microsoft Expression Blend.

XAML is used with several technologies, but there are differences among the various technologies. With the XML namespace, which is mapped as the default with WPF applications, WPF extensions to XAML are defined. WPF makes use of dependency properties, attached properties, and several WPF-specific markup extensions. WF 4 uses the XML namespace for the definition of the Workflow activities. The XML namespace ...

Get Professional C# 4 and .NET 4 now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.