fbpx
维基百科

XAML

XAML(Extensible Application Markup Language i/ˈzæməl/)是Windows Presentation Foundation(WPF)和Universal Windows Platform(UWP)的一部分,是微软开发的一種基于XML、基于声明,用于初始化结构化值和对象的使用者介面描述語言,它有著HTML的外觀,又揉合了XML語法的本質,例如:可以使用<Button>標籤設定按鈕(Button)。它類似Linux平台下的glade。至於WinFX XAML Browser Application(XBAP)是用XAML作界面描述,在瀏覽器中執行的程式,可取代過去的ActiveXJava AppletFlash

XAML WPF应用程序

XAML本質上屬於一種.NET编程语言,屬於通用語言運行庫(Common Language Runtime),同C#VB.NET等同。與HTML類似,特点是用來描述使用者介面。XAML的语法格式为:<Application... />,Application是必備的基本元素。XAML可以定義2D和3D物件、旋轉(rotations)、動畫(animations),以及各式各樣的效果。

Hello world 编辑

  • C# UWP
<Page  x:Class="UwpAppExample.MainPage"  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"  xmlns:local="using:UwpAppExample"  xmlns:d="http://schemas.microsoft.com/expression/blend/2008"  xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"  mc:Ignorable="d"  Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">  <Grid>  <Button Margin="10,0,10,0" Height="100" Click="Hello_Click" Content="Click Me!"/>  </Grid>  </Page> 


using System; using Windows.UI.Xaml.Controls; namespace UwpAppExample {  public sealed partial class MainPage : Page  {  public MainPage()  {  this.InitializeComponent();  }  private async void Button_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e)  {  await new Windows.UI.Popups.MessageDialog("Hello World!").ShowAsync();  }  } } 
  • C# WPF
<Window x:Class="WpfAppExample.MainWindow"  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"  xmlns:d="http://schemas.microsoft.com/expression/blend/2008"  xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"  xmlns:local="clr-namespace:WpfAppExample"  mc:Ignorable="d"  Title="MainWindow" Height="350" Width="525">  <Grid>  <Button Margin="10,0,10,0" Height="100" Click="Hello_Click" Content="Click Me!"/>  </Grid> </Window> 


using System.Windows;  namespace WpfAppExample {  public partial class MainWindow : Window  {  public MainWindow()  {  InitializeComponent();  }   private void Hello_Click(object sender, RoutedEventArgs e)  {  MessageBox.Show("Hello World!");  }  } } 
  • Visual Basic dotNet
<Window x:Class="WpfAppExample.MainWindow"  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"  xmlns:d="http://schemas.microsoft.com/expression/blend/2008"  xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"  xmlns:local="clr-namespace:WpfAppExample"  mc:Ignorable="d"  Title="MainWindow" Height="350" Width="525">  <Grid>  <Button Margin="10,0,10,0" Height="100" Click="Hello_Click" Content="Click Me!"/>  </Grid> </Window> 


Imports System.Windows Class MainWindow Sub New() InitializeComponent() End Sub Private Sub Hello_Click(sender As Object, e As RoutedEventArgs) MessageBox.Show("Hello World!") End Sub End Class

参考资料 编辑

外部連結 编辑

  • 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
  • - LightWave to XAML converter
  • XAML and Technical Authors (页面存档备份,存于互联网档案馆) A discussion of the affect of the open nature of XAML.
  • A selection of categorized resources on XAML.
  • LearnWPF Website to learn WPX. (页面存档备份,存于互联网档案馆
  • - A great discussion board for questions on XAML and the WPF

xaml, 此條目没有列出任何参考或来源, 2017年4月13日, 維基百科所有的內容都應該可供查證, 请协助補充可靠来源以改善这篇条目, 无法查证的內容可能會因為異議提出而被移除, 此條目需要精通或熟悉计算机科学的编者参与及协助编辑, 請邀請適合的人士改善本条目, 更多的細節與詳情請參见討論頁, 另見其他需要计算机科学專家關注的頁面, extensible, application, markup, language, 是windows, presentation, foundation, 和universal,. 此條目没有列出任何参考或来源 2017年4月13日 維基百科所有的內容都應該可供查證 请协助補充可靠来源以改善这篇条目 无法查证的內容可能會因為異議提出而被移除 此條目需要精通或熟悉计算机科学的编者参与及协助编辑 請邀請適合的人士改善本条目 更多的細節與詳情請參见討論頁 另見其他需要计算机科学專家關注的頁面 XAML Extensible Application Markup Language i ˈ z ae m el 是Windows Presentation Foundation WPF 和Universal Windows Platform UWP 的一部分 是微软开发的一種基于XML 基于声明 用于初始化结构化值和对象的使用者介面描述語言 它有著HTML的外觀 又揉合了XML語法的本質 例如 可以使用 lt Button gt 標籤設定按鈕 Button 它類似Linux平台下的glade 至於WinFX XAML Browser Application XBAP 是用XAML作界面描述 在瀏覽器中執行的程式 可取代過去的ActiveX Java Applet Flash XAML WPF应用程序 XAML本質上屬於一種 NET编程语言 屬於通用語言運行庫 Common Language Runtime 同C VB NET等同 與HTML類似 特点是用來描述使用者介面 XAML的语法格式为 lt Application gt Application是必備的基本元素 XAML可以定義2D和3D物件 旋轉 rotations 動畫 animations 以及各式各樣的效果 Hello world 编辑C UWP lt Page x Class UwpAppExample MainPage xmlns http schemas microsoft com winfx 2006 xaml presentation xmlns x http schemas microsoft com winfx 2006 xaml xmlns local using UwpAppExample xmlns d http schemas microsoft com expression blend 2008 xmlns mc http schemas openxmlformats org markup compatibility 2006 mc Ignorable d Background ThemeResource ApplicationPageBackgroundThemeBrush gt lt Grid gt lt Button Margin 10 0 10 0 Height 100 Click Hello Click Content Click Me gt lt Grid gt lt Page gt using System using Windows UI Xaml Controls namespace UwpAppExample public sealed partial class MainPage Page public MainPage this InitializeComponent private async void Button Click object sender Windows UI Xaml RoutedEventArgs e await new Windows UI Popups MessageDialog Hello World ShowAsync C WPF lt Window x Class WpfAppExample MainWindow xmlns http schemas microsoft com winfx 2006 xaml presentation xmlns x http schemas microsoft com winfx 2006 xaml xmlns d http schemas microsoft com expression blend 2008 xmlns mc http schemas openxmlformats org markup compatibility 2006 xmlns local clr namespace WpfAppExample mc Ignorable d Title MainWindow Height 350 Width 525 gt lt Grid gt lt Button Margin 10 0 10 0 Height 100 Click Hello Click Content Click Me gt lt Grid gt lt Window gt using System Windows namespace WpfAppExample public partial class MainWindow Window public MainWindow InitializeComponent private void Hello Click object sender RoutedEventArgs e MessageBox Show Hello World Visual Basic dotNet lt Window x Class WpfAppExample MainWindow xmlns http schemas microsoft com winfx 2006 xaml presentation xmlns x http schemas microsoft com winfx 2006 xaml xmlns d http schemas microsoft com expression blend 2008 xmlns mc http schemas openxmlformats org markup compatibility 2006 xmlns local clr namespace WpfAppExample mc Ignorable d Title MainWindow Height 350 Width 525 gt lt Grid gt lt Button Margin 10 0 10 0 Height 100 Click Hello Click Content Click Me gt lt Grid gt lt Window gt Imports System Windows Class MainWindow Sub New InitializeComponent End Sub Private Sub Hello Click sender As Object e As RoutedEventArgs MessageBox Show Hello World End Sub End Class参考资料 编辑外部連結 编辑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 取自 https zh wikipedia org w index php title XAML amp oldid 71703993, 维基百科,wiki,书籍,书籍,图书馆,

文章

,阅读,下载,免费,免费下载,mp3,视频,mp4,3gp, jpg,jpeg,gif,png,图片,音乐,歌曲,电影,书籍,游戏,游戏。