XBF Key.jpg
   HOME

TheInfoList



OR:

Extensible Application Markup Language (XAML ) is a declarative XML-based language that Microsoft developed for initializing structured values and objects. It is available under Microsoft's
Open Specification Promise The Microsoft Open Specification Promise (or OSP) is a promise by Microsoft, published in September 2006, to not assert its patents, in certain conditions, against implementations of a certain list of specifications. The OSP is not a licence, but r ...
. XAML is used extensively in Windows Presentation Foundation (WPF),
Silverlight Microsoft Silverlight is a discontinued application framework designed for writing and running rich web applications, similar to Adobe Inc., Adobe's Run time environment, runtime, Adobe Flash. A plugin for Silverlight is still available for a v ...
,
Workflow Foundation Windows Workflow Foundation (WF) is a Microsoft technology that provides an API, an in-process workflow engine, and a rehostable designer to implement long-running processes as workflows within .NET applications. The latest version of WF was re ...
(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) and Universal Windows Platform (UWP). In WPF and UWP, XAML is a user interface markup language to define UI elements, data binding, and events. In WF, however, XAML defines workflows. 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 instructio ...
(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 (WPF).Rob Relyea : January 2004 – Posts
Before the end .NET Framework 3.0 development, however, Microsoft adopted XAML for
Workflow Foundation Windows Workflow Foundation (WF) is a Microsoft technology that provides an API, an in-process workflow engine, and a rehostable designer to implement long-running processes as workflows within .NET applications. The latest version of WF was re ...
(WF). In WPF, XAML describes visual user interfaces. 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 The Binary Application Markup Language is a file format developed by Microsoft that is generated by compiling XAML files. Generation An XAML file can be compiled into a Binary Application Markup Language file with the .BAML extension, which may b ...
(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) is the process of translating a data structure or object state into a format that can be stored (e.g. files in secondary storage devices, data buffers in primary storage devices) or transmitted (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 called ''Template''s; differing from Cascading Style Sheet syntax, it is closer to
XBL XBL (''XML Binding Language'') is an XML-based markup language for altering the behavior of XUL widgets. It was devised at Netscape in the late 1990s as an extension of XUL. The primary use of XBL was in the Firefox web browser, but Mozilla depre ...
. To create XAML files, one could use
Microsoft Expression Blend Microsoft Blend for Visual Studio (formerly Microsoft Expression Blend) is a user interface design tool developed and sold by Microsoft for creating graphical interfaces for web and desktop applications that blend the features of these two types ...
,
Microsoft Visual Studio Visual Studio is an integrated development environment (IDE) from Microsoft. It is used to develop computer programs including websites, web apps, web services and mobile apps. Visual Studio uses Microsoft software development platforms such a ...
, the hostable WF visual designer, or XAMLPad.


Example

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 your computer. Using a schema that Microsoft recommends, the example can also be Hello, world! This can be integrated into a Web page if WPF is installed using
XBAP XAML Browser Applications (XBAP, pronounced "ex-bap") are Windows Presentation Foundation (.xbap) applications that are hosted and run inside a web browser such as Firefox or Internet Explorer. Hosted applications run in a partial trust sandbox en ...
s (XAML Browser Applications) that are compiled applications running in a sandboxed environment hosted within the browser. Another way is to use the Silverlight plugin. The code cannot be included directly in an HTML page; rather it must be loaded into the page via JavaScript. If .NET 3.0 or later is installed, loose XAML files can also be viewed on their own in a compatible Web browser (including Internet Explorer and Firefox) in conjunction with the .NET Framework 3.0, without the need for the Silverlight plugin. Loose XAML files are markup-only files limited to defining the visual content to be rendered. They are not compiled with an application. XAML Example The ''MySilverlight.js'' file must contain the code that loads the above XAML code (as an XML file) under the ''MySilverlight'' HTML element. A crucial part of utilizing XAML to its full potential is making appropriate usage of binding, as well as being comfortable with creating your own custom user elements as required, for your specific needs. Binding can be done as follows:


Differences between versions of XAML

There are three main Microsoft implementations of XAML: * Windows Presentation Foundation (WPF), first available with
.NET Framework 3.0 Microsoft started development on the .NET Framework in the late 1990s originally under the name of Next Generation Windows Services (NGWS). By late 2001 the first beta versions of .NET 1.0 were released. The first version of .NET Framework was ...
*
Silverlight Microsoft Silverlight is a discontinued application framework designed for writing and running rich web applications, similar to Adobe Inc., Adobe's Run time environment, runtime, Adobe Flash. A plugin for Silverlight is still available for a v ...
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 and Windows Server 2012, 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 targets the development of native desktop applications on Windows 11 and Windows 10 back to version 1809. Windows App SDK does not replac ...
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.


Response from the competition

In 2007,
European Committee for Interoperable Systems The European Committee for Interoperable Systems (ECIS) is an international non-profit association founded in 1989 in order to promote interoperability and market conditions in the Information and Communications Technology (ICT) sector allowing vigo ...
(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. 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 The following is a list of user interface markup languages. By vendor or platform Flash *MXML *OpenLaszlo Java * Thinletbr>* ZK Framework, ZUML Ajax web application UI generator *FXML/JavaFX See alsOpen Source XML UI Toolkits in Java Microsoft * ...
*
Comparison of user interface markup languages The following tables compare general and technical information for some user interface markup languages. Please see the individual markup languages' articles for further information. General information Basic general information about the markup la ...
: * EMML *
FXML FXML is an XML-based user interface markup language created by Oracle Corporation for defining the user interface of a JavaFX application. FXML presents an alternative to designing user interfaces using procedural code, and allows for abstracting ...
* MXML * XPS * XUL *
ZUML ZK is an open-source Ajax Web application framework, written in Java, that enables creation of graphical user interfaces for Web applications with little required programming knowledge. The core of ZK consists of an Ajax-based event-driven mechan ...
* Interface Builder *
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 manne ...


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