O'Reilly logo

Professional C# 6 and .NET Core 1.0 by 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

29 Core XAML

What’s In This Chapter?

  • XAML syntax
  • Dependency properties
  • Routed events
  • Attached properties
  • Markup extensions

Wrox.com Code Downloads for This Chapter

The wrox.com code downloads for this chapter are found at www.wrox.com/go/professionalcsharp6 on the Download Code tab. The code for this chapter is divided into the following major examples, for both WPF and Universal Windows apps:

  • Code Intro
  • XAML Intro
  • Dependency Objects
  • Routed Events
  • Attached Properties
  • Markup Extensions

Uses of XAML

When you’re writing a .NET application, usually C# is not the only syntax you need to know. If you write Universal Windows apps, Windows desktop applications using Windows Presentation Foundation (WPF), or workflows with Windows Workflow Foundation (WF); create XPS documents, or write Silverlight apps, you also need XAML. XAML (eXtensible Application Markup Language) is a declarative XML syntax that’s usually needed with these applications. This chapter describes the syntax of XAML and the extensibility mechanisms that are available with this markup language. The chapter describes the differences between XAML in WPF applications and Windows apps using the Universal Windows Platform (UWP).

All that can be done with XAML can also be done with C#—so why is there a need for XAML? XAML is typically used to describe objects and their properties, and this is possible in a deep hierarchy. For example, a Window control contains a Grid control; the Grid control contains a StackPanel

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