Extensible Application Markup Language
Extensible Application Markup Language (XAML, pronounced /ˈzæməl/) is a declarative XML-based language created by Microsoft which is used to initialize structured values and objects. It is available under Microsoft's Open Specification Promise.[1] The acronym originally stood for Extensible Avalon Markup Language - Avalon being the code-name for Windows Presentation Foundation (WPF).[2]
Overview
XAML is used extensively in .NET Framework 3.0 technologies, particularly Windows Presentation Foundation (WPF), Silverlight, and Windows Workflow Foundation (WF). In WPF, XAML is used as a user interface markup language to define UI elements, data binding, eventing, and other features. In WF, workflows can be defined using XAML.
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 such as 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 such as XAMLPad, or a graphical editor such as 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[3]. As a result, 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. As it is strongly linked to the .NET Framework 3.0 technologies, the only fully compliant implementation as of today is Microsoft's[citation needed].
Technology
A XAML file can be compiled into a .baml (Binary XAML) 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.
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".[4][5]
Templates
XAML uses a specific way to define look and feel called Templates, differing from Cascading Style Sheet syntax; it is closer to XBL[6].
Example
This Windows Presentation Foundation example shows the text "Hello World!" in the top-level XAML container called Canvas.
<Canvas xmlns="http://schemas.microsoft.com/client/2007"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<TextBlock>Hello World!</TextBlock>
</Canvas>
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 [7]
<Canvas xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<TextBlock>Hello World!</TextBlock>
</Canvas>
This can be integrated into a web page if WPF is installed using XBAPs (XAML Browser Applications) which 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. [8] Loose XAML files are markup-only files limited to defining the visual content to be rendered. They are not compiled with an application.
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>XAML Example</title>
<script type="text/javascript" src="MySilverlight.js" />
<script type="text/javascript" src="Silver.js" />
</head>
<body>
<div id="MySilverlight" >
</div>
<script type="text/javascript">
createMySilverlight();
</script>
</body>
</html>
The MySilverlight.js file must contain the code that loads the above XAML code (as an XML file) under the MySilverlight html element.
Criticism
The European Committee for Interoperable Systems[9] argues that Microsoft's use of XAML in its Silverlight product aims to introduce content on the World Wide Web that can only be accessed from the Windows platform.
However, using a plugin, XAML is viewable in some non-Microsoft browsers on Windows and Mac, and Microsoft provides direct support for Novell's development of a Silverlight viewer for GNU/Linux called Moonlight[10]. As of January 2010, Moonlight 2 is a compatible implementation of Silverlight 2[11].
See also
- List of user interface markup languages
- Comparison of user interface markup languages
- Open XML Paper Specification
- JavaFX
- EMML
- Layout manager
- ZUML
- NextStep/Cocoa Interface Builder
References
- ↑ Microsoft adds XAML to 'Open Specification' list - Software Development Times On The Web
- ↑ Rob Relyea : January 2004 - Posts
- ↑ "XAML Syntax Terminology". Microsoft Corporation. http://msdn2.microsoft.com/en-us/library/ms788723.aspx.
- ↑ MSDN forum post by the WF product manager
- ↑ RuleML and BPEL are other examples of XML-based declarative logic languages
- ↑ Guthrie, Scott (2008-02-22). "Silverlight Tutorial Part 7: Using Control Templates to Customize a Control's Look and Feel". http://weblogs.asp.net/scottgu/pages/silverlight-tutorial-part-7-using-control-templates-to-customize-a-control-s-look-and-feel.aspx. Retrieved 2008-03-08.
- ↑ Microsoft XAML Overview page at XAML Overview (Root element and xmlns)
- ↑ Windows Presentation Foundation on the Web: Web Browser Applications - MSDN
- ↑ "Microsoft runs into EU Vista charges". itwire.com. 2007-01-28. http://www.itwire.com/content/view/8988/53/. Retrieved 2008-04-16.
- ↑ Foley, Mary Jo (2007-09-25). "Microsoft officially ‘extends support’ for Novell’s Silverlight Linux port". zdnet.com. http://blogs.zdnet.com/microsoft/?p=695. Retrieved 2007-10-13.
- ↑ "Releasing Moonlight 2, Roadmap to Moonlight 3 and 4". Miguel de Icaza. http://tirania.org/blog/archive/2009/Dec-17.html. Retrieved 2009-12-17.
External links
This article may require cleanup to meet Wikipedia's quality standards. Please improve this article if you can. (December 2008) |
|
If you like SEOmastering Site, you can support it by - BTC: bc1qppjcl3c2cyjazy6lepmrv3fh6ke9mxs7zpfky0 , TRC20 and more...
- Pages using deprecated source tags
- Pages with syntax highlighting errors
- Pages using duplicate arguments in template calls
- All articles with unsourced statements
- Articles with unsourced statements from April 2008
- Articles with invalid date parameter in template
- Pages with broken file links
- Articles needing cleanup from December 2008
- All pages needing cleanup
- XML-based standards
- User interface markup languages
- Microsoft application programming interfaces
- Vector graphics markup languages
- Declarative markup languages
- Microsoft Windows multimedia technology
- Declarative programming languages
- .NET framework
- Markup languages