XAML, language for building graphical user interfaces
XAML eases to create, edit and reuse graphical user interfaces for desktop
and Web applications.
It is for Windows what XUL is to Firefox and FXML to JavaFX.
XAML means for "Extensible Application Markup Language", and is a XML format
dedicated for graphical user interface. Actually the meaning changed over time, the code name of WPF, "Avalon", was once a part of the acronym.
This is a Microsoft product which seem to have got inspiration from Mozilla's XUL and it requires the .NET environment on Seven and WinRT on Windows 8.
This schema shows XAML on Windows 8.
Both on the legacy desktop GUI throught .NET, and on the Modern UI for immersive apps.
Microsoft has created a plugin for browsers designed as an alternative to Flash, Silverlight, which allows you to use XAML on any browser. However, its development was abandoned because HTML 5 with the canvas tag and augmented with SVG provides the essential features of Silverlight, which makes the latter now useless. XAML remains an alternative to HTML 5 for immersive applications on Windows 8.
Originally designed to create applications on the platform WPF of Vista, XAML did not really fit in Windows before the version 8.
It actually has the ability to describe a user interface much more easily than HTML, but it is limited to applications specific to Windows while HTML is a universal standard.
See What future for XAML? for a detailed analysis.
XAML describes objects of the interface with their presentation
It is easier to write apps with XAML than with XUL or any other markup language using CSS, but they will be then harder to modify.
- The XML code is compiled to intermediate code.
- Tags and properties of XAML have a direct counterpart in the .NET library as embedded classes and attributes.
- Uses vectorial graphical images.
- Presenting properties are a part of the language (unlike XUL that uses the CSS).
- Ability to use .NET classes from XAML.
- Events (as mouse clic) are properties of tags, and tags are widgets.
Sample of XAML code
Displaying "Hello world!":
<Page xmlns=""> <TextBlock> Hello, World! </TextBlock> </Page>
Drawing a button:
<button Background="Gray" FontSize="18pt" Click="OnClick"> Submit </button>