XAML
维基百科,自由的百科全书
Extensible Application Markup Language,XAML,是WPF(Windows Presentation Foundation)的一部分,是一種XML的使用者介面描述語言,有著HTML的外觀,又揉合了XML語法的本質,例如:可以使用<Button>標籤設定按鈕(Button)。類似Linux平台下的glade。至於WinFX XAML Browser Application(XBAP)是用XAML作界面描述,在瀏覽器中執行的程式,可取代過去的ActiveX、Java Applet、Flash。
XAML本質上屬於一種.NET Programming Language,屬於通用語言執行時(Common Language Runtime),同C#、VB.NET等同。與HTML類似,特点是用來描述使用者介面。XAML的语法格式为:<Application... />,Application是必備的基本元素。XAML可以定義2D 和 3D 物件、旋轉(rotations)、動畫(animations),以及各式各樣的效果。^
Hello world(C#) [编辑]
'''Page1.xaml''' <Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <Button>Hello, world!</Button> </Page> '''Page1.xaml.cs''' using System; using System.Windows; using System.Windows.Controls; namespace WpfSample { public partial class Page1 : Page { void HelloWorld(object sender, RoutedEventArgs e) { MessageBox.Show("Hello, world!"); } } }
<Canvas>
<Button Name="button1" Click="Clicked">Click Me!</Button>
<x:Code><![CDATA[
void Clicked(object sender, RoutedEventArgs e)
{
button1.Content = "Hello World";
}
]]></x:Code>
</Canvas>
外部連結 [编辑]
- Microsoft XAML overview
- XAMLdev.com A selection of categorized resources on XAML
- XAML Controls from Microsoft Longhorn Developer Introduction
- XAML used in Microsoft .NET platform
- XAMJ, open source Java based project
- United XAML Initiative - Open Source XAML Alternatives
- Shaxam - LightWave to XAML converter
- XAML and Technical Authors A discussion of the affect of the open nature of XAML.
- XAML page on NetFXGuide.com A selection of categorized resources on XAML.
- LearnWPF Website to learn WPX.
- XAML Discussion Board - A great discussion board for questions on XAML and the WPF
|
|||||||||||||||||||||||||||||||