XAML is one language with several vocabularies. A .xaml file does not say which framework it is for; the namespaces on the root do, and some frameworks share a namespace, so a file may fit more than one. The viewer’s Overview tab names the framework it concludes from the file and gives the reason.
What was checked against a source: the namespaces and language namespace of WPF, UWP, WinUI, Avalonia and .NET MAUI, and the x: names each of them documents. Rows and paragraphs for Silverlight, Windows Phone, Uno Platform, Xamarin.Forms and Windows Workflow Foundation, and the lists of version differences, were written from memory and are marked below as not checked.
Telling them apart
| Framework | Default namespace | Language namespace | Other signs |
|---|---|---|---|
| WPF | …/winfx/2006/xaml/presentation | 2006 | clr-namespace: mappings; roots Window, NavigationWindow, Application, FlowDocument, FixedPage; Style.Triggers, DataTrigger, pack:// addresses |
| Silverlight 2 to 5, Windows Phone Silverlight (not checked) | the same | 2006 | clr-namespace:…;assembly=System.Windows.Controls.*, VisualStateManager, navigation:Page, phone:PhoneApplicationPage; no triggers except EventTrigger on Loaded |
| Silverlight 1.0 (not checked) | http://schemas.microsoft.com/client/2007 | 2006 | root Canvas; event names are JavaScript functions |
| UWP, WinUI | the same | 2006 | using: mappings, {x:Bind}, {ThemeResource}, x:Load |
| Uno Platform (not checked) | the same, with platform namespaces (xmlns:not_win="http://uno.ui/not_win", xmlns:android="http://uno.ui/android") and mc:Ignorable for them | 2006 | WinUI style markup that runs on other systems |
| Xamarin.Forms (not checked beyond the namespace) | http://xamarin.com/schemas/2014/forms | 2009 (not checked) | roots ContentPage, MasterDetailPage; Entry, StackLayout, OnPlatform |
| .NET MAUI | http://schemas.microsoft.com/dotnet/2021/maui | 2009 | Shell, x:DataType, AppThemeBinding, OnPlatform, OnIdiom; using: and clr-namespace: mappings |
| Avalonia | https://github.com/avaloniaui | 2006 | Style Selector, using: mappings, x:CompileBindings, x:DataType, x:True |
| Windows Workflow Foundation 4 (not checked beyond the namespace) | http://schemas.microsoft.com/netfx/2009/xaml/activities | 2006 (not checked) | root Activity with x:Class, Sequence, Variable, InArgument |
| Windows Workflow Foundation 3 (not checked) | http://schemas.microsoft.com/winfx/2006/xaml/workflow | 2006 | .xoml, SequentialWorkflowActivity, StateMachineWorkflowActivity |
| Visual Studio rule files (not checked) | http://schemas.microsoft.com/build/2009/properties | — | root Rule, children StringProperty, BoolProperty, EnumProperty |
XAML 2006 and 2009
See the language namespace page. The .NET MAUI documentation writes the 2009 URI for x:; the WPF, UWP and Avalonia documentation write the 2006 one. WPF accepts the XAML 2009 features only in XAML that is not markup-compiled, and does not compile them to BAML.
WPF
The origin of the language: a vocabulary of dependency properties, routed events, resources, styles with triggers, templates, data binding with converters and validation, documents, 3D and animation (elements). What each version added that shows in markup (from memory, not checked against a source): .NET Framework 3.0, the first; 3.5 SP1, StringFormat on bindings, DataGrid and DatePicker in the toolkit; 4.0, DataGrid, DatePicker and Calendar in the framework, easing functions, VisualStateManager, System.Xaml with XAML 2009 and x:Reference; 4.5, Delay and ValidatesOnNotifyDataErrors on bindings; .NET Core 3.0 and later, the same language, built by the SDK for desktop applications.
Silverlight and Windows Phone
Not checked against a source. A subset of WPF for the browser plug-in and the phone: no routed Preview events, no property triggers or data triggers (visual states instead), no DynamicResource, no MultiBinding, an ElementName binding, StringFormat from version 4, x:Name as a resource key, Visibility of Visible and Collapsed only, VisualStateManager and CompositeTransform. Silverlight 1.0 used a different root and JavaScript event handlers.
UWP and WinUI
The same language over the Windows Runtime. The UWP documentation covers the using: mappings, {x:Bind}, {ThemeResource}, x:Uid with resource files and x:Load; the rest of this list was not checked against a source. Differences from WPF: using: mappings; no Style.Triggers; visual states, StateTrigger and AdaptiveTrigger; {x:Bind} (compiled) alongside {Binding}; {ThemeResource}; x:Uid with .resw files; x:Load; ms-appx: addresses; CommandBar, NavigationView, SplitView, RelativePanel; theme dictionaries keyed Default, Light, HighContrast. WinUI 2 is the control library as a package (namespace Microsoft.UI.Xaml.Controls, used in UWP markup with xmlns:muxc="using:Microsoft.UI.Xaml.Controls"); WinUI 3 is the desktop version with Window as a markup root, which is not a visual element; its XAML types are in Microsoft.UI.Xaml where UWP’s are in Windows.UI.Xaml, and the markup text looks the same.
Xamarin.Forms and .NET MAUI
Cross-platform pages; the .NET MAUI documentation writes the XAML 2009 namespace for them, and Xamarin.Forms was not checked. The vocabulary is its own (Label, Entry, StackLayout, Grid, CollectionView), with BindingContext instead of DataContext, Command instead of most events, OnPlatform and OnIdiom, Shell navigation, VisualStateManager and x:DataType compiled bindings. MAUI’s namespace differs from Xamarin.Forms’s, and MAUI has handlers where Forms had renderers, which does not show in markup. The .NET MAUI documentation describes XAML compilation (XAMLC) and loading XAML at run time.
Avalonia
A cross-platform framework modelled on WPF: the same elements and binding, with a CSS-like style system (Style Selector=…, classes, pseudo-classes), ControlTheme, using: mappings, compiled bindings, the binding path operators #name, $parent, $self, ^, and the extension .axaml.
Windows Workflow Foundation
Not checked against a source beyond the notes on x:Members in the .NET documentation. XAML that describes a program. The root is an Activity (or a specific one such as Sequence or Flowchart) in the activities namespace; x:Class names a custom activity; x:Members with x:Property declares its arguments (the type is written in a convention that Workflow Foundation defines); child elements are activities (Sequence, If with Then and Else, While, Assign, WriteLine, Delay, Parallel, TryCatch, Flowchart, StateMachine), with Variable x:TypeArguments="x:Int32" Name="count" declarations and expressions written in Visual Basic or C# inside [ ] or in expression activities. A .xamlx file is a workflow service with WorkflowService, Receive and SendReply. Workflow 3 files (.xoml) are different markup in the 2006 workflow namespace.
Not described
Known, not yet covered
- Reference: the version history is given as what each major version added in the vocabulary that shows in markup, from memory and not checked against a source; it is not a full change list, and the version numbers of MAUI, WinUI and Avalonia releases are not given.
- Reference: the Silverlight, Windows Phone, Uno Platform, Xamarin.Forms and Workflow Foundation rows and paragraphs, and the list of differences between UWP and WPF, still need a source.
- Reference: Windows Workflow Foundation activities, expression syntax (
[ ]and the VB expression text) and the Uno Platform’s platform namespaces are summarised.
Unknown
- Reference: the framework-detection rules of the viewer are heuristics: a file in the presentation namespace with none of the signs above is shown as “WPF, UWP, WinUI or Silverlight”.