HOME

TheInfoList



OR:

Extensible Application Markup Language (XAML ) is a declarative
XML Extensible Markup Language (XML) is a markup language and file format for storing, transmitting, and reconstructing data. It defines a set of rules for encoding electronic document, documents in a format that is both human-readable and Machine-r ...
-based language developed by
Microsoft Microsoft Corporation is an American multinational corporation and technology company, technology conglomerate headquartered in Redmond, Washington. Founded in 1975, the company became influential in the History of personal computers#The ear ...
for initializing structured values and objects. It is available under Microsoft's Open Specification Promise. XAML is used extensively in
Windows Presentation Foundation Windows Presentation Foundation (WPF) is a free and open-source user interface framework for Windows-based desktop applications. WPF applications are based in .NET, and are primarily developed using C# and XAML. Originally developed by Microso ...
(WPF),
Silverlight Microsoft Silverlight is a discontinued application framework designed for writing and running rich internet applications, similar to Adobe's runtime, Adobe Flash. While early versions of Silverlight focused on streaming media, later version ...
, Workflow Foundation (WF),
Windows UI Library Windows UI Library (WinUI codenamed "Jupiter", and also known as UWP XAML and WinRT XAML) is a user interface API that is part of the Windows Runtime programming model that forms the backbone of Universal Windows Platform apps (formerly known as ...
(WinUI),
Universal Windows Platform Universal Windows Platform (UWP) is a computing platform created by Microsoft and introduced in Windows 10. The purpose of this platform is to help develop universal apps that run on Windows 10, Windows 10 Mobile (discontinued), Windows 11, Xbox ...
(UWP), and .NET Multi-platform App UI (.NET MAUI). In WPF and UWP, XAML is a
user interface markup language A user interface markup language is a markup language that renders and describes graphical user interfaces and controls. Many of these markup languages are dialects of XML and are dependent upon a pre-existing scripting language engine, usually a ...
to define UI elements, data binding, and events. In WF, however, XAML defines
workflow Workflow is a generic term for orchestrated and repeatable patterns of activity, enabled by the systematic organization of resources into processes that transform materials, provide services, or process information. It can be depicted as a seque ...
s. XAML elements map directly to
Common Language Runtime The Common Language Runtime (CLR), the virtual machine component of Microsoft .NET Framework, manages the execution of .NET programs. Just-in-time compilation converts the managed code (compiled intermediate language code) into machine instr ...
(CLR) object instances, while XAML attributes map to CLR properties and events on those objects. Anything that is created or implemented in XAML can be expressed using a more traditional .NET language, such as C# or Visual Basic .NET. However, a key aspect of the technology is the reduced complexity needed for tools to process XAML, because it is based on XML.


Technology

XAML originally stood for Extensible Avalon Markup Language, ''Avalon'' being the code-name for
Windows Presentation Foundation Windows Presentation Foundation (WPF) is a free and open-source user interface framework for Windows-based desktop applications. WPF applications are based in .NET, and are primarily developed using C# and XAML. Originally developed by Microso ...
(WPF). Before the end of .NET Framework 3.0 development, however, Microsoft adopted XAML for Workflow Foundation (WF). In WPF, XAML describes visual
user interface In the industrial design field of human–computer interaction, a user interface (UI) is the space where interactions between humans and machines occur. The goal of this interaction is to allow effective operation and control of the machine fro ...
s. WPF allows for the definition of both 2D and 3D objects, rotations, animations, and a variety of other effects and features. A XAML file can be compiled into a Binary Application Markup Language (BAML) file, which may be inserted as a resource into a .NET Framework assembly. At run-time, the framework engine extracts the BAML file from assembly resources, parses it, and creates a corresponding WPF visual tree or workflow. In WF contexts, XAML describes potentially long-running declarative logic, such as those created by process modeling tools and rules systems. The
serialization In computing, serialization (or serialisation, also referred to as pickling in Python (programming language), Python) is the process of translating a data structure or object (computer science), object state into a format that can be stored (e. ...
format for workflows was previously called XOML, to differentiate it from UI markup use of XAML, but now they are no longer distinguished. However, the file extension for files containing the workflow markup is still ".xoml". XAML uses a specific way to define
look and feel In software design, the look and feel of a graphical user interface comprises aspects of its design, including elements such as colors, shapes, layout, and typefaces (the "look"), as well as the behavior of dynamic elements such as buttons, boxes ...
called ''Template''s; differing from Cascading Style Sheet syntax, it is closer to XBL. To create XAML files, one could use Microsoft Expression Blend,
Microsoft Visual Studio Visual Studio is an integrated development environment (IDE) developed by Microsoft. It is used to develop computer programs including websites, web apps, web services and mobile apps. Visual Studio uses Microsoft software development platforms ...
, the hostable WF visual designer, or XAMLPad.


Examples

This Windows Presentation Foundation example shows the text "Hello, world!" in the top-level XAML container called Canvas. Hello, world! The schema (the part) may have to be changed to work on some computers. Using a schema that Microsoft recommends, the example can also be Hello, world! A crucial part of utilizing XAML to its full potential is making appropriate usage of binding, as well as creating custom user elements as required. Binding can be done as follows:


Differences between versions of XAML

There are three main Microsoft implementations of XAML: *
Windows Presentation Foundation Windows Presentation Foundation (WPF) is a free and open-source user interface framework for Windows-based desktop applications. WPF applications are based in .NET, and are primarily developed using C# and XAML. Originally developed by Microso ...
(WPF), first available with .NET Framework 3.0 *
Silverlight Microsoft Silverlight is a discontinued application framework designed for writing and running rich internet applications, similar to Adobe's runtime, Adobe Flash. While early versions of Silverlight focused on streaming media, later version ...
3 and 4, first available for Internet Explorer 6 and now deprecated *
Windows UI Library Windows UI Library (WinUI codenamed "Jupiter", and also known as UWP XAML and WinRT XAML) is a user interface API that is part of the Windows Runtime programming model that forms the backbone of Universal Windows Platform apps (formerly known as ...
(formerly UWP XAML and WinRT XAML), first shipped with
Windows 8 Windows 8 is a major release of the Windows NT operating system developed by Microsoft. It was Software release life cycle#Release to manufacturing (RTM), released to manufacturing on August 1, 2012, made available for download via Microsoft ...
and
Windows Server 2012 Windows Server 2012, codenamed "Windows Server 8", is the ninth major version of the Windows NT operating system produced by Microsoft to be released under the Windows Server brand name. It is the server version of Windows based on Windows ...
, but now available as a part of the
Windows App SDK Windows App SDK (formerly known as Project Reunion) is a software development kit (SDK) from Microsoft that provides a unified set of APIs and components that can be used to develop desktop applications for both Windows 11 and Windows 10 version ...
These versions have some differences in the parsing behavior. Additionally, the Silverlight 4 XAML parser is not 100% backward-compatible with Silverlight 3 files. Silverlight 3 XAML files may be rejected or parsed differently by the Silverlight 4 parser.


XAML applications in web browsers

Historically, XAML based applications could be run in some
web browsers A web browser, often shortened to browser, is an application for accessing websites. When a user requests a web page from a particular website, the browser retrieves its files from a web server and then displays the page on the user's scree ...
, such as
Internet Explorer Internet Explorer (formerly Microsoft Internet Explorer and Windows Internet Explorer, commonly abbreviated as IE or MSIE) is a deprecation, retired series of graphical user interface, graphical web browsers developed by Microsoft that were u ...
and
Firefox Mozilla Firefox, or simply Firefox, is a free and open-source web browser developed by the Mozilla Foundation and its subsidiary, the Mozilla Corporation. It uses the Gecko rendering engine to display web pages, which implements curr ...
. This could be achieved through XBAP files created from WPF applications, or via the
Silverlight Microsoft Silverlight is a discontinued application framework designed for writing and running rich internet applications, similar to Adobe's runtime, Adobe Flash. While early versions of Silverlight focused on streaming media, later version ...
browser plugin. However, both these methods are now unsupported on all major browsers due to their reliance on the discontinued NPAPI browser plugin interface.


Lock-in concerns

In 2007, European Committee for Interoperable Systems (ECIS) – a coalition of mostly American software companies – accused Microsoft of attempting to hijack HTML and replace it with XAML, thus creating a
vendor lock-in In economics, vendor lock-in, also known as proprietary lock-in or customer lockin, makes a customer dependent on a vendor for products, unable to use another vendor without substantial switching costs. The use of open standards and alternati ...
. Jeremy Reimer, writing for ''
Ars Technica ''Ars Technica'' is a website covering news and opinions in technology, science, politics, and society, created by Ken Fisher and Jon Stokes in 1998. It publishes news, reviews, and guides on issues such as computer hardware and software, sci ...
'' described this comment as "the most egregious error" and added that XAML is unlikely to ever replace HTML.


See also

* List of user interface markup languages * Comparison of user interface markup languages: * EMML * FXML *
MXML MXML is an XML-based user interface markup language first introduced by Macromedia in March 2004. Application developers use MXML in combination with ActionScript to develop rich web applications, with products such as Apache Flex. Adobe Syst ...
* XPS * XUL * ZUML *
Interface Builder Interface Builder is a software development application for Apple's macOS operating system. It is part of Xcode (formerly Project Builder), the Apple Developer developer's toolset. Interface Builder allows Cocoa and Carbon developers to crea ...
*
Layout manager Layout managers are software components used in widget toolkits which have the ability to lay out graphical control elements by their relative positions without using distance units. It is often more natural to define component layouts in this mann ...


References


External links


XAML Language ReferenceXAML for UWP: OverviewXAML for WPF: OverviewSystem.Windows.Markup NamespaceSystem.Xaml Namespace
{{Document markup languages .NET terminology Declarative markup languages Declarative programming languages Markup languages Microsoft application programming interfaces Microsoft Windows multimedia technology User interface markup languages Vector graphics markup languages XML-based standards