XAML - What is XAML?

转载 2007年09月27日 15:52:00
XAML - What is XAML?
XAML-Microsoft Extensible Application Markup Language  XAML and WPF
XAML is based on Extensible Markup Language (XML) and enables developers to specify a hierarchy of objects with a set of properties and logic.
XAML (Extensible Application Markup Language) is a code-name for the Microsoft 'Longhorn' Markup Language. This XAML is not to be confused with "Transaction Authority Markup Language (XAML)."

Providing up-to-date information and resources on XAML and other XAML-related topics.

What is XAML?

(Extensible Application Markup Language; pronounced "zammel")

XAML is a declarative XML-based language that defines objects and their properties in XML. XAML syntax focuses upon defining the UI (user interface) for the Windows Presentation Foundation (WPF) and is therefore separate from the application code behind it.

Although XAML is presently for use on the Windows platform, the WPF/E (Windows Presentation Foundation/Everywhere) initiative will eventually bring XAML to other platforms and devices.

XAML syntax describes objects, properties and their relationships to one another. Generic XAML syntax defines the relationship between objects and children. Properties can be set as attributes or by using 'period notation' to specify the object as a property of its parent.

For example:
程序代码 程序代码
<child property="x" property="y">
      <class property="u" property="v"/>

Things You Should Know About XAML

Sometimes, XAML and WPF are used interchangeably ... they do go hand-in-hand, but they are not the same. XAML is a type of XML-based markup. WPF is a graphics API.

XAML is different from SVG (Scalable Vector Graphics). According to the W3C’s definition of SVG, it is "a platform for two-dimensional graphics ... (with) two parts: an XML-based file format and a programming API for graphical applications." While XAML is an XML-based file format, it is not an API. XAML also supports things like 3D and controls, which SVG does not.

One great benefit of XAML is that it helps to separate design and development, which actually helps to improve collaboration and efficiency between designers and software developers. As the XAML markup for an application's UI remains separate from the remainder of application logic, a designer's exact layout can be saved in XAML and combined with the application without affecting the development process.

XAML documents are saved as .xaml files.

What is WPF?

(Windows Presentation Foundation; formerly Avalon)

WPF is the new presentation API (Application Programming Interface) in .NET Framework 3.0 (formerly WinFX).

Users can program directly against the API with .NET, instantiate (render) WPF objects by expressing them in XAML, or employ a mixture of XAML with .NET code behind.

The WPF API has a wide range of functionality, from Windows controls like buttons to 3D graphics, special effects and multimedia. WPF enables the creation of items that presently require different file formats – for example, the equivalent of PDF, HTML, WinForms and Flash can be developed with WPF.

For more details on WPF, check out msdn's Windows Presentation Foundation section.

What is a XBAP?

(XAML Browser Application; formerly WBA or Web Browser Application)

A XBAP, or XAML Browser Application allows a WPF/XAML-based application to run in an Internet browser without installing on the user's computer.

Microsoft Corporation states:

[a]pplications can be deployed from a server to a system with a single click. The application then runs in the browser without any interruptions beyond the time needed to download the application. However, unlike ... HTML-based applications, XAML Browser Applications have access to the rich features of the Windows Presentation Foundation (formerly code-named "Avalon") runtime.
See msdn’s site for more information on XAML Browser Applications.

Check out the Avalon Clock and Paint Factory

Quick Start XAML Guide...
This section of xaml.net will help you get up and running fast with regards to creating, editing, and viewing XAML documents. Don't forget to check the Resources section for other useful links.

Here is what you need to create, edit, and view XAML documents:
What to install:
1. Visual Studio 2005
2. .NET 3.0 SDK
3. .NET 3.0 Visual Studio 2005 Extensions

Note: If you will be building Silverlight (formerly WPF /E) applications you will need to get the Silverlight SDK. Visual Studio 2005 is optional, if you are using a XAML Designer like Aurora XAML Designer and code the JavaScript.

End-users will need to download and install the Silverlight module to view Silverlight Rich Internet Applications. (I.E. 6+ and Firefox

Choose a XAML Designer:

Aurora XAML Designer
● Expression Blend
XamlPad (xamlpad.exe) is a basic visual editor for Extensible Application Markup Language (XAML).
● Notepad

XAML实例教程系列 - 事件(Event)

Events,中文称为事件,是Windows消息机制中重要概念之一,也是最常见的人机交互手段之一。 XAML和其他开发语言类似,具有事件机能,帮助应用管理用户输入,执行不同的行为。 根据用户...
  • jv9
  • jv9
  • 2012年06月19日 01:38
  • 5698


简介 XAML是eXtensible Application Markup Language可扩展应用程序标记语言,它是微软公司为构建应用程序用户界面而创建的一种新的描述性语言。XAML提供了一种便...
  • bigpudding24
  • bigpudding24
  • 2015年10月27日 11:18
  • 865


实际上XAML的开发应该是在blend里面完成,在vs中精调。 一XAML中控件及其类别 1.1关于控件(control)的概念...
  • zhangwenjiawangwang
  • zhangwenjiawangwang
  • 2016年10月16日 17:50
  • 390


 使用RotateTransform进行旋转变形Angle属性定义选择角度,CenterX,CenterY旋转中心点。 使...
  • kntao
  • kntao
  • 2010年07月13日 15:44
  • 2513


编译:XAML与程序代码结合(Compilation: Mixing XAML with Procedural Code)            wpf应用程序完全可以用纯程序代码来实现。而XAML的...
  • kissjob
  • kissjob
  • 2010年04月27日 10:48
  • 1177


      最近下载了windows sdk,也来凑下热闹学学新技术。顺便也简单的记录下学习过程.此非教程.由于刚接触,一切皆以实用为主.先了解其特性为好.一.xaml的结构为xml形式组成,与f...
  • clingingboy
  • clingingboy
  • 2007年03月04日 11:09
  • 391

WPF XAML X名称空间详解

X名称空间里面的成员(如X:Name,X:Class)都是写给XAML编译器看的、用来引导XAML编译器将XAML代码编译为CLR代码。 【X名称空间里面到底都有些什么】     x名称空间...
  • aoshilang2249
  • aoshilang2249
  • 2015年03月18日 21:19
  • 1673


内容控件: TextBox的Text属性表示文本,是string型。但是Button
  • u011423446
  • u011423446
  • 2014年06月22日 18:16
  • 570

XAML 编码规范 (思考)

1.尽量和Blend统一 2.兄弟元素之间需要空行 4.父子元素之间不需要空格 3.每行尽量单个属性5.Grid的Row和Column定义不需要空行6.Style里的Setter中不需要单行一个属性7...
  • muzizongheng
  • muzizongheng
  • 2013年07月10日 15:43
  • 783


它微软推出的基于Windows Vista的用户界面框架;它提供了统一的编程模型、语言和框架,真正做到了分离界面设计人员与开发人员的工作。WPF和.NET中winForm是类似的。...
  • suneqing
  • suneqing
  • 2014年10月23日 21:31
  • 4263
您举报文章:XAML - What is XAML?