World Library  
Flag as Inappropriate
Email this Article
 

Xaml

Extensible Application Markup Language (XAML)
Filename extension .xaml
Internet media type application/xaml+xml
Developed by Microsoft
Initial release v1.0 / June 2008 (2008-06)[1]
Latest release v2009 / 16 April 2010; 4 years ago (2010-04-16)[2][3]
Type of format User interface markup language
Extended from XML

Extensible Application Markup Language (XAML,

XAML is used extensively in .NET Framework 3.0 & .NET Framework 4.0 technologies, particularly Windows Presentation Foundation (WPF), Silverlight, Windows Workflow Foundation (WF) and Windows Runtime XAML Framework. In WPF, XAML forms a user interface markup language to define UI elements, data binding, eventing, and other features. In WF, workflows can be defined using XAML. XAML can also be used in Silverlight applications, Windows Phone apps and Windows Store apps.

XAML elements map directly to Common Language Runtime object instances, while XAML attributes map to Common Language Runtime properties and events on those objects. XAML files can be created and edited with visual design tools like Microsoft Expression Blend, Microsoft Visual Studio, and the hostable Windows Workflow Foundation visual designer. They can also be created and edited with a standard text editor, a code editor like XAMLPad, or a graphical editor like Vector Architect.

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.[6] Consequently, a variety of products are emerging, particularly in the WPF space, which create XAML-based applications. As XAML is simply based on XML, developers and designers are able to share and edit content freely amongst themselves without requiring compilation. Since it is strongly linked to the .NET Framework 3.0 technologies, the only fully compliant implementation at present is Microsoft's..

Technology

A XAML file can be compiled into a .BAML file (Binary Application Markup Language[7]), 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.

When used in Windows Presentation Foundation, XAML is used to describe visual user interfaces. WPF allows for the definition of both 2D and 3D objects, rotations, animations, and a variety of other effects and features.

When used in Windows Workflow Foundation contexts, XAML is used to describe potentially long-running declarative logic, such as those created by process modeling tools and rules systems. The serialization 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".[8][9]

Templates

XAML uses a specific way to define look and feel called Templates; differing from Cascading Style Sheet syntax, it is closer to XBL.[10]

Example

This Windows Presentation Foundation example shows the text "Hello World!" in the top-level XAML container called Canvas.

2007"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
  Hello World!

The schema (the xmlns="http://schemas.microsoft.com..." part) may have to be changed to work on your computer. Using a schema that Microsoft recommends, the example can also be

[11]

2006/xaml/presentation">
  Hello World!

This can be integrated into a Web page if WPF is installed using XBAPs (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.[12] Loose XAML files are markup-only files limited to defining the visual content to be rendered. They are not compiled with an application.

1999/xhtml">
  
    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.

Differences between versions of XAML

There are four Microsoft main implementations of XAML:

These versions have some differences in the parsing behavior.[13]

Additionally, the XAML parsing between Silverlight 3 and Silverlight 4 is not 100% forwards compatible; XAML files which are accepted by Silverlight 3 may not be accepted or parsed differently in Silverlight 4.[14]

Criticism

The European Committee for Interoperable Systems said in 2007 that Microsoft's use of XAML in its Silverlight product aimed to introduce content on the World Wide Web that could only be accessed from the Windows platform.[15][16] Using a plugin, XAML is viewable in some non-Microsoft browsers on Windows and Mac, and Microsoft supported Novell's Silverlight viewer for GNU/Linux called Moonlight.[17] As of January 2010, Moonlight 2 was compatible with Silverlight 2, but development of Moonlight was later discontinued.[18]

See also

References

External links

  • Microsoft XAML overview

This article was sourced from Creative Commons Attribution-ShareAlike License; additional terms may apply. World Heritage Encyclopedia content is assembled from numerous content providers, Open Access Publishing, and in compliance with The Fair Access to Science and Technology Research Act (FASTR), Wikimedia Foundation, Inc., Public Library of Science, The Encyclopedia of Life, Open Book Publishers (OBP), PubMed, U.S. National Library of Medicine, National Center for Biotechnology Information, U.S. National Library of Medicine, National Institutes of Health (NIH), U.S. Department of Health & Human Services, and USA.gov, which sources content from all federal, state, local, tribal, and territorial government publication portals (.gov, .mil, .edu). Funding for USA.gov and content contributors is made possible from the U.S. Congress, E-Government Act of 2002.
 
Crowd sourced content that is contributed to World Heritage Encyclopedia is peer reviewed and edited by our editorial staff to ensure quality scholarly research articles.
 
By using this site, you agree to the Terms of Use and Privacy Policy. World Heritage Encyclopedia™ is a registered trademark of the World Public Library Association, a non-profit organization.
 


Copyright © World Library Foundation. All rights reserved. eBooks from Project Gutenberg are sponsored by the World Library Foundation,
a 501c(4) Member's Support Non-Profit Organization, and is NOT affiliated with any governmental agency or department.