Extensible Application Markup Language: Difference between revisions
→Criticism: hit piece. |
|||
Line 65: | Line 65: | ||
The ''MySilverlight.js'' file must contain the code that loads the above XAML code (as a XML file) code under the ''MySilverlight'' html element. |
The ''MySilverlight.js'' file must contain the code that loads the above XAML code (as a XML file) code under the ''MySilverlight'' html element. |
||
==Criticism== |
|||
{{main|Microsoft Silverlight#Criticism}} |
|||
The [[European Committee for Interoperable Systems|ECIS]] argues that Microsoft's use of XAML in its [[Microsoft Silverlight|Silverlight]] product aims to introduce content on the [[world wide web|web]] that can only be served from the [[Microsoft Windows|Windows]] platform. |
|||
==References== |
==References== |
Revision as of 02:09, 17 April 2008
Filename extension |
.xaml |
---|---|
Internet media type |
application/xaml+xml |
Developed by | Microsoft |
Type of format | markup language |
Extensible Application Markup Language (XAML, pronounced zammel ([zæ:mɛl])) by Microsoft is a declarative XML-based language used to initialize structured values and objects. The acronym originally stood for Extensible Avalon Markup Language, where Avalon was the code-name for Windows Presentation Foundation (WPF).[1]
Overview
XAML is used extensively in .NET Framework 3.0 technologies, particularly Windows Presentation Foundation (WPF) 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, or with developer tools such as XAMLPad.
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, as it is strongly linked to the .NET Framework 3.0 technologies, the only fully compliant implementation as of today is Microsoft's.
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".[2][3].
Templates
XAML uses a specific way to define Look and feel called Templates, different from the Cascading Style Sheets syntax, but closer to XBL[4].
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>
One way for this to be shown in a Web browser is via the Silverlight plugin. The code can not be included directly in the html page; rather it must be loaded via JavaScript.
<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 a XML file) code under the MySilverlight html element.
References
- ^ Rob Relyea : January 2004 - Posts
- ^ 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". Retrieved 2008-03-08.
{{cite web}}
: Check date values in:|date=
(help)
See also
- List of user interface markup languages
- Comparison of user interface markup languages
- JavaFX
- Layout manager
- ZUML
- NextStep/Cocoa Interface Builder
External links
- WPF SDK Microsoft Developer Network's top-level portal to the Windows Presentation Foundation SDK which documents WPF technologies including XAML.
- Microsoft XAML overview
- XAMLdev.com selection of categorized resources on XAML
- XAML Controls from Microsoft Longhorn Developer Introduction
- United XAML Initiative - Open Source XAML Alternatives
- XAML page on NetFXGuide.com A selection of categorized resources on XAML.
- LearnWPF Website to learn WPF
- Website resource for markup language technologies
- Free XAML Designs Website
- Mediaportal, an Open source mediacenter application which includes an opensource xaml/wpf skinengine
- A LightWave 3D > XAML object converter