O'Reilly logo

Professional C# 4 and .NET 4 by Morgan Skinner, Karli Watson, Jay Glynn, Bill Evjen, Christian Nagel

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 27. Core XAML

WHAT'S IN THIS CHAPTER?

  • 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.

OVERVIEW

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 http://schemas.microsoft.com/winfx/2006/xaml/presentation, 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 http://schemas.microsoft.com/netfx/2009/xaml/activities for the definition of the Workflow activities. The XML namespace http://schemas.microsoft.com/winfx/2006/xaml ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required