Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Extensible Application Markup Language
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{short description|Language Microsoft developed for initializing structured values and objects}} {{Infobox file format | name = Extensible Application Markup Language (XAML) | icon = | logo = | screenshot = | caption = | extension = <code>.xaml</code> | mime = application/xaml+xml | type code = | uniform type = | magic = | owner = [[Microsoft]] | released = {{Start date and age|2006|11|df=yes}}<ref>{{cite web | url = https://download.microsoft.com/download/0/a/6/0a6f7755-9af5-448b-907d-13985accf53e/%5BMS-XAML%5D.pdf | title = [MS-XAML] Xaml Object Mapping Specification 2006 | publisher = [[Microsoft]] | date = June 2008}}</ref> | latest release version = v2019 | latest release date = {{Start date and age|2019|03|12|df=yes}}<ref>{{cite web | url = http://www.microsoft.com/downloads/details.aspx?FamilyID=52a193d1-d14f-4335-aa86-c53193e1885d&displayLang=en | title = Extensible Application Markup Language (XAML) | publisher = [[Microsoft]] | date = 12 March 2019}}</ref> | genre = [[User interface markup language]] | container for = | contained by = | extended from = [[XML]] | extended to = | standard = | free = | url = }} '''Extensible Application Markup Language''' ('''XAML''' {{IPAc-en||audio=En-us-xaml.ogg|Λ|z|Γ¦|m|Ιl}}) is a [[declarative programming|declarative]] [[XML]]-based language developed by [[Microsoft]] for initializing structured values and objects. It is available under Microsoft's [[Open Specification Promise]].<ref>{{Cite web |url=http://www.sdtimes.com/(X(1)S(kw21wu45u03kzpnafqlanyiy))/content/article.aspx?ArticleID=31886&AspxAutoDetectCookieSupport=1 |title=Microsoft adds XAML to 'Open Specification' list β Software Development Times On The Web<!-- Bot generated title --> |archive-url=https://web.archive.org/web/20081211204034/http://www.sdtimes.com/%28X%281%29S%28kw21wu45u03kzpnafqlanyiy%29%29/content/article.aspx?ArticleID=31886&AspxAutoDetectCookieSupport=1 |archive-date=2008-12-11 |url-status=dead |author-first=David |author-last=Worthington|access-date=2021-04-06}}</ref> XAML is used extensively in [[Windows Presentation Foundation]] (WPF), [[Silverlight]], [[Windows Workflow Foundation|Workflow Foundation]] (WF), [[Windows UI Library]] (WinUI), [[Universal Windows Platform]] (UWP), and [[.NET#.NET_MAUI|.NET Multi-platform App UI]] (.NET MAUI). In WPF and UWP, XAML is a [[user interface markup language]] to define UI elements, data binding, and events. In WF, however, XAML defines [[workflow]]s. XAML elements map directly to [[Common Language Runtime]] (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 Sharp (programming language)|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.<ref>{{cite web|date=12 August 2021|title=XAML Syntax In Detail|url=https://docs.microsoft.com/en-us/dotnet/desktop/wpf/advanced/xaml-syntax-in-detail?view=netframeworkdesktop-4.8|website=Windows Presentation Foundation library|publisher=[[Microsoft]]|via=[[Microsoft Docs]]}}</ref> ==Technology== XAML originally stood for Extensible Avalon Markup Language, ''Avalon'' being the code-name for [[Windows Presentation Foundation]] (WPF).<ref name=":1">{{usurped|1=[https://web.archive.org/web/20071011212059/http://www.windows-now.com/blogs/rrelyea/archive/2004/01.aspx Rob Relyea : January 2004 β Posts<!-- Bot generated title -->]}}</ref> Before the end of .NET Framework 3.0 development, however, Microsoft adopted XAML for [[Windows Workflow Foundation|Workflow Foundation]] (WF).<ref name=":1" /> In WPF, XAML describes visual [[user interface]]s. 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]] (BAML) file,<ref name=":1" /><ref>{{cite web | author = unknown | date = 2009-07-30 | publisher = DOTNET Spider | title = What is BAML? | quote = BAML means Binary Application Markup Language, which is a compiled version of the XAML. When you compile your XAML it creates the BAML file. | url = http://www.dotnetspider.com/forum/216053-What-BAML.aspx}}</ref> 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]] 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".<ref>{{Cite web|last=Andrew|first=Paul|date=25 January 2006|title=xoml or xaml?|url=https://social.msdn.microsoft.com/Forums/en-US/590589ef-fdf0-4a1c-86b9-1cc7ad65df31/xoml-or-xaml?forum=windowsworkflowfoundation|archive-url=https://web.archive.org/web/20201128092236/https://social.msdn.microsoft.com/Forums/en-US/590589ef-fdf0-4a1c-86b9-1cc7ad65df31/xoml-or-xaml?forum=windowsworkflowfoundation|url-status=dead|archive-date=November 28, 2020|website=MSDN Community Archive|publisher=[[Microsoft]]<!--Paul Andrew represents Microsoft-->|quote="Workflow programs (or models) are saved in the XAML format which is common to Avalon for serializing .NET types as XML. Avalon XAML is all about UI and Workflow XAML is all about business process so there's quite a semantic difference. The XOML file extension looks to remain for Workflow models though the file format is XAML."}}</ref> XAML uses a specific way to define [[look and feel]] called ''Template''s; differing from [[Cascading Style Sheet]] syntax, it is closer to [[XBL]].<ref>{{cite web|last=Guthrie|first=Scott|date=22 February 2008|title=Silverlight Tutorial Part 7: Using Control Templates to Customize a Control's Look and Feel|url=https://weblogs.asp.net/scottgu/silverlight-tutorial-part-7-using-control-templates-to-customize-a-control-s-look-and-feel|website=ScottGu's Blog}}</ref> To create XAML files, one could use [[Microsoft Expression Blend]], [[Microsoft Visual Studio]], the hostable WF visual designer, or XAMLPad.<ref name="Avery">{{cite web |last1=Avery |first1=James |last2=Holmes |first2=Jim |title=3.3 Writing XAML in XamlPad - Windows Developer Power Tools [Book] |url=https://www.oreilly.com/library/view/windows-developer-power/0596527543/ch03s04.html |website=www.oreilly.com |publisher=O'Reilly |language=en}}</ref> ==Examples== This Windows Presentation Foundation example shows the text "Hello, world!" in the top-level XAML container called Canvas. <syntaxhighlight lang="XML"> <Canvas xmlns="http://schemas.microsoft.com/client/2010" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <TextBlock>Hello, world!</TextBlock> </Canvas> </syntaxhighlight> The schema (the {{code|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<ref>Microsoft XAML Overview page at [https://msdn.microsoft.com/en-us/library/ms752059.aspx#xaml_files XAML Overview (Root element and xmlns)]</ref> <syntaxhighlight lang="XML"> <Canvas xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"> <TextBlock>Hello, world!</TextBlock> </Canvas> </syntaxhighlight> 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:<syntaxhighlight lang="xml"> <TextBox x:Name="txtInput" /> <TextBlock Text="{Binding ElementName=txtInput,Path=Text}" /> </syntaxhighlight> ==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 Silverlight|Silverlight]] 3 and 4, first available for [[Internet Explorer 6]] and now deprecated * [[Windows UI Library]] (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]] These versions have some differences in the parsing behavior.<ref>{{cite web|date=17 November 2011|title=XAML Processing Differences Between Silverlight Versions and WPF|url=https://docs.microsoft.com/en-us/previous-versions/windows/silverlight/dotnet-windows-silverlight/cc917841(v=vs.95)|website=Silverlight Archive|publisher=[[Microsoft]]|via=[[Microsoft Docs]]|quote=''Silverlight includes a XAML parser that is part of the Silverlight core install. Silverlight uses different XAML parsers depending on whether your application targets Silverlight 3 or Silverlight 4. The two parsers exist side-by-side in Silverlight 4 for compatibility. In some cases, the XAML parsing behavior in Silverlight differs from the parsing behavior in Windows Presentation Foundation (WPF). WPF has its own XAML parser.''}}</ref> Additionally, the Silverlight 4 XAML parser is not 100% [[Backward compatibility|backward-compatible]] with Silverlight 3 files. Silverlight 3 XAML files may be rejected or parsed differently by the Silverlight 4 parser.<ref>{{cite web|date=17 November 2011|title=XAML Processing Differences Between Silverlight Versions|url=https://docs.microsoft.com/en-us/previous-versions/windows/silverlight/dotnet-windows-silverlight/ff457753(v=vs.95)|website=Silverlight Archive|publisher=[[Microsoft]]|via=[[Microsoft Docs]]}}</ref> == XAML applications in web browsers == Historically, XAML based applications could be run in some [[Web browser|web browsers]], such as [[Internet Explorer]] and [[Firefox]]. This could be achieved through [[XAML Browser Applications|XBAP]] files created from [[Windows Presentation Foundation|WPF]] applications, or via the [[Microsoft Silverlight|Silverlight]] browser plugin. However, both these methods are now unsupported on all major browsers due to their reliance on the discontinued [[NPAPI]] browser plugin interface.<ref>{{Cite web |last=adegeo |title=FAQ about XBAP supportability |url=https://learn.microsoft.com/en-us/dotnet/desktop/wpf/app-development/xbap-faq?view=netframeworkdesktop-4.8 |access-date=2024-05-16 |website=learn.microsoft.com |language=en-us}}</ref><ref>{{Cite web |last=nakarnam |date=2020-03-16 |title=Silverlight End of Support - Microsoft Lifecycle |url=https://learn.microsoft.com/en-us/lifecycle/announcements/silverlight-end-of-support |access-date=2024-05-16 |website=learn.microsoft.com |language=en-us}}</ref> ==Lock-in concerns== In 2007, [[European Committee for Interoperable Systems]] (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]].<ref>{{cite web|last=Beer|first=Stan|date=28 January 200|title=Microsoft runs into EU Vista charges|url=http://www.itwire.com/it-industry-news/strategy/8988-microsoft-runs-into-eu-vista-charges|access-date=22 August 2013|website=iTWire|publisher=}}</ref><ref name=":0">{{cite web|last=Reimer|first=Jeremy|date=26 January 2007|title=European committee chair accuses Microsoft of hijacking the web|url=https://arstechnica.com/uncategorized/2007/01/8715/|access-date=22 August 2013|work=[[Ars Technica]]|publisher=[[CondΓ© Nast]]}}</ref> Jeremy Reimer, writing for ''[[Ars Technica]]'' described this comment as "the most egregious error" and added that XAML is unlikely to ever replace HTML.<ref name=":0" /> ==See also== *[[List of user interface markup languages]] *[[Comparison of user interface markup languages]]: {{div col|colwidth=10em|style=margin-left:2em}} *[[EMML]] *[[FXML]] *[[MXML]] *[[Open XML Paper Specification|XPS]] *[[XUL]] *[[ZUML]] {{div col end}} *[[Interface Builder]] *[[Layout manager]] ==References== {{Reflist|30em}} ==External links== {{Wikibooks|.NET Development Foundation}} * [https://docs.microsoft.com/en-us/dotnet/desktop/xaml-services/?redirectedfrom=MSDN XAML Language Reference] *[https://docs.microsoft.com/en-us/windows/uwp/xaml-platform/xaml-overview XAML for UWP: Overview] *[https://docs.microsoft.com/en-us/dotnet/desktop/wpf/xaml/?view=netdesktop-5.0 XAML for WPF: Overview] *[https://docs.microsoft.com/en-us/dotnet/api/system.windows.markup?view=netframework-4.8 System.Windows.Markup Namespace] *[https://docs.microsoft.com/en-us/dotnet/api/system.xaml?view=netframework-4.8 System.Xaml Namespace] {{.NET Framework}} {{Widget toolkits}} {{Graphics file formats}} {{Document markup languages}} [[Category:.NET terminology]] [[Category:Declarative markup languages]] [[Category:Declarative programming languages]] [[Category:Markup languages]] [[Category:Microsoft application programming interfaces]] [[Category:Microsoft Windows multimedia technology]] [[Category:User interface markup languages]] [[Category:Vector graphics markup languages]] [[Category:XML-based standards]]
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)
Pages transcluded onto the current version of this page
(
help
)
:
Template:.NET Framework
(
edit
)
Template:Cite web
(
edit
)
Template:Code
(
edit
)
Template:Div col
(
edit
)
Template:Div col end
(
edit
)
Template:Document markup languages
(
edit
)
Template:Graphics file formats
(
edit
)
Template:IPAc-en
(
edit
)
Template:Infobox file format
(
edit
)
Template:Reflist
(
edit
)
Template:Short description
(
edit
)
Template:Usurped
(
edit
)
Template:Widget toolkits
(
edit
)
Template:Wikibooks
(
edit
)