XAML
Microsoft's XML-based declarative markup language for building user interfaces - born as part of the Longhorn project, released with WPF in 2006, and still defining UIs today across WinUI, .NET MAUI, and Avalonia.
Created by Microsoft
XAML - the Extensible Application Markup Language - is Microsoft’s XML-based declarative language for describing user interfaces and object graphs. Rather than constructing windows, buttons, and layouts in imperative code, a XAML developer declares them: each XML element maps directly to a .NET or Windows Runtime object, each attribute to a property or event. A <Button> tag in a .xaml file is a Button object, instantiated by a parser instead of a constructor call in C#.
That simple idea - markup as object instantiation - has proven remarkably durable. First released in November 2006 with Windows Presentation Foundation, XAML went on to power Silverlight in the browser, Windows 8 and UWP apps, Xamarin.Forms on mobile, and today’s WinUI 3, .NET MAUI, and the open-source Avalonia framework. Two decades on, XAML remains the default answer to “how do you build a UI in the Microsoft ecosystem?”
History & Origins
Longhorn and Avalon (2003)
XAML emerged from one of the most ambitious projects in Microsoft’s history: Longhorn, the Windows release that eventually became Windows Vista. At the Professional Developers Conference in Los Angeles in October 2003, Microsoft unveiled Longhorn’s pillars, including Avalon - a new vector-based graphics and presentation engine designed to replace the aging GDI-based Windows UI stack. Avalon interfaces would be described in a new XML-based markup language, and the name made the lineage explicit: XAML originally stood for Extensible Avalon Markup Language.
PDC attendees took home a Longhorn preview build whose SDK already included an early XAML compiler. As Avalon matured into a shippable product, it was renamed Windows Presentation Foundation (WPF), and the acronym was retrofitted to Extensible Application Markup Language - a fitting change, since before .NET Framework 3.0 shipped, Microsoft had also adopted XAML as the serialization format for Windows Workflow Foundation, where it describes workflows rather than user interfaces.
Release with .NET Framework 3.0 (2006)
XAML officially arrived in November 2006 as part of .NET Framework 3.0, released alongside Windows Vista. WPF gave Windows developers resolution-independent vector graphics, hardware-accelerated rendering, animation, styling, templating, and rich data binding - and XAML was the language that tied it all together. Microsoft’s tooling strategy leaned into the split between markup and code: developers worked in Visual Studio, while designers could style the same XAML files in Expression Blend.
Beyond the Desktop
XAML quickly escaped its desktop origins:
- Silverlight (September 2007), developed under the codename WPF/E (“WPF Everywhere”), brought a XAML-based presentation framework to web browsers as a plugin, competing with Adobe Flash.
- Windows Phone used Silverlight’s XAML dialect for app development.
- Windows 8 (2012) introduced a native XAML framework for Windows Runtime apps - implemented in C++ rather than managed code, usable from C#, Visual Basic, and C++.
- Xamarin.Forms (May 2014) extended XAML to cross-platform mobile development for iOS and Android.
In 2008 Microsoft published the [MS-XAML] XAML Object Mapping Specification, placing the core language under the Microsoft Open Specification Promise. The specification was last revised as v2019 in March 2019.
Design Philosophy
Markup as Object Graph
XAML’s core principle is a direct, mechanical mapping between markup and objects. Elements are types, attributes are properties or events, and nesting expresses containment:
| |
Everything above could be written in equivalent C# - XAML adds no runtime capability that code lacks. What it adds is shape: a UI tree reads naturally as nested markup, tooling can render it live, and designers and developers can work on the same artifact.
Separation of Presentation and Logic
XAML pairs each markup file with a “code-behind” class, but its data binding system encourages going further. The Model-View-ViewModel (MVVM) pattern - articulated in 2005 by John Gossman, an architect on the WPF team - uses XAML bindings to connect the view to a testable, UI-agnostic view model, and became the dominant architecture across the XAML ecosystem.
Declarative, Not Turing-Complete
XAML is deliberately not a general-purpose programming language. It has no loops, conditionals, or arithmetic of its own; logic lives in the languages it partners with (C#, F#, Visual Basic, C++). This restraint is a feature: because a XAML document is just a serialized object graph, tools can load, analyze, edit, and re-save it without executing arbitrary code.
Key Features
Markup Extensions
Curly-brace markup extensions let attributes express more than literal strings - references to shared resources, and most importantly, data bindings:
| |
{Binding} connects a UI property to a data source property, with change notification keeping the two synchronized - the machinery that makes MVVM practical.
Styles, Templates, and Resources
XAML separates a control’s behavior from its appearance. Styles apply property sets across many controls; control templates can completely replace a control’s visual tree; data templates declare how bound data objects should be rendered. Resource dictionaries make all of these shareable and theme-able.
Compilation to BAML
In WPF, XAML files are not shipped as raw XML: the build process compiles them into BAML (Binary Application Markup Language), a pre-tokenized binary form embedded in the assembly that is faster to load and parse at runtime.
Attached Properties and Dependency Properties
XAML dialects rely on dependency properties (which support binding, animation, and styling) and attached properties, which let a container attach data to its children - Grid.Row="2" on a button, for example, stores layout information owned by the grid, not the button.
The XAML Family
“XAML” today names a family of closely related dialects rather than a single implementation:
| Framework | Years | Where it runs |
|---|---|---|
| WPF | 2006-present | Windows desktop (.NET Framework, modern .NET) |
| Windows Workflow Foundation | 2006-present | Workflow definitions (not UI) |
| Silverlight | 2007-2021 | Browser plugin (support ended October 2021) |
| WinRT / UWP XAML | 2012-present | Windows 8/10/11 apps |
| Xamarin.Forms | 2014-2024 | iOS, Android, Windows |
| WinUI 3 | 2021-present | Windows desktop via Windows App SDK |
| .NET MAUI | 2022-present | iOS, Android, Windows, macOS |
| Avalonia (third party, open source) | 2016-present | Windows, macOS, Linux, and more |
The dialects share syntax and core concepts but differ in namespaces, available controls, and details of the binding system - enough that Microsoft proposed a unifying “XAML Standard” at Build 2017, an effort that was ultimately shelved in favor of letting each framework evolve independently.
Evolution
XAML’s language layer has been notably stable. The largest revision, informally called XAML 2009, arrived with .NET Framework 4 in 2010 alongside the System.Xaml assembly, which lifted XAML parsing and object-graph services out of WPF into the framework proper - enabling any library to define and consume its own XAML vocabularies.
The bigger story is the evolution of the frameworks around it. Silverlight rose and fell with the browser-plugin era (support ended in October 2021). The Windows 8 WinRT push made XAML native code. Open-sourcing WPF, Windows Forms, and WinUI in December 2018, followed by WPF support in .NET Core 3.0 (September 2019), moved desktop XAML onto the modern .NET platform. WinUI 3 (Windows App SDK 1.0, November 2021) decoupled the Windows XAML stack from the OS release cycle, and .NET MAUI (May 2022) consolidated the Xamarin.Forms lineage. Meanwhile the community-driven Avalonia project - begun as “Perspex” and renamed in 2016 - and Uno Platform carry XAML-style development to macOS, Linux, and the web.
Current Relevance
XAML is not a niche survivor; it is the working present of Windows and .NET UI development. WPF remains one of the most widely deployed desktop frameworks in enterprise software, WinUI 3 is Microsoft’s current native UI platform for Windows apps, and .NET MAUI is its first-party cross-platform mobile answer. Avalonia has built a substantial open-source ecosystem of its own, powering cross-platform applications such as Wasabi Wallet.
The competitive landscape has shifted around it - Electron, Flutter, React Native, and the web absorb much cross-platform work, and even Microsoft ships many apps as web hybrids - but for data-dense native Windows software, the XAML stack remains the default choice, with active development across Microsoft’s repositories and a deep pool of third-party control vendors (Telerik, DevExpress, Syncfusion, and others).
Why It Matters
XAML mainstreamed the idea that a user interface is best expressed as a declarative document rather than a procedure:
- Declarative UI at scale. XAML demonstrated to a generation of business-software developers that markup plus data binding beats hand-wired imperative UI code - years before declarative UI became fashionable again in React, SwiftUI, and Jetpack Compose (which favor code-based declarations over markup).
- MVVM. The pattern that grew out of XAML’s binding system became one of the most influential UI architectures of the 2000s and 2010s, well beyond Microsoft platforms.
- Designer-developer separation. The XAML toolchain was an early, serious attempt to let designers and developers collaborate on the same living artifact instead of throwing mockups over a wall.
- Direct influence. Qt’s QML, among others, lists XAML as an influence, and third-party ecosystems like Avalonia and Uno Platform chose XAML precisely because its concepts and developer base endure.
From a codename-laden preview at PDC 2003 to the markup behind Visual Studio, Windows Terminal, and modern Windows itself, XAML has quietly described more running user interfaces than almost any other UI language of its era - a markup dialect that outlived the operating system project it was named for.
Timeline
Notable Uses & Legacy
Visual Studio
Microsoft's flagship IDE has used WPF - and therefore XAML - for its shell and editor UI since Visual Studio 2010, making it one of the largest XAML applications in existence.
Windows Terminal
Microsoft's open-source terminal application renders its tabs, panes, and settings UI with Windows XAML hosted via XAML Islands.
Windows 11 shell experiences
Modern surfaces of Windows 11, including WinUI-based elements of File Explorer and other in-box apps, are built with the WinUI XAML framework.
Wasabi Wallet
The open-source, privacy-focused Bitcoin wallet builds its cross-platform desktop UI with Avalonia, an open-source XAML framework running on Windows, macOS, and Linux.
Enterprise line-of-business applications
Trading desks, healthcare systems, engineering tools, and countless internal corporate desktop applications use WPF and XAML for data-dense, MVVM-architected Windows front ends.
Cross-platform mobile apps with .NET MAUI
.NET shops use MAUI's XAML dialect to define UIs once and deploy native apps to iOS, Android, Windows, and macOS from a single C# codebase.