English to Chinese: Developing .NET Applications General field: Tech/Engineering Detailed field: IT (Information Technology) | |
Source text - English XAML is a declarative markup language based on Extensible Markup Language (XML). XAML is pronounced as zammel. It simplifies the User Interface (UI) creation of the .NET Framework applications, such as a WPF application. However, it does not define a model to control the flow of the program. Therefore, it is important to link the application logic code with the markup code in XAML.
In addition, XAML separates the UI definition from run-time logic by using code-behind files that are associated with XAML markup through partial class definitions. This enables to separate the work of a designer and a programmer. Therefore, implementation of the XAML allows the designer to concentrate on the design-related tasks and a programmer to implement the application logic.
XAML is a case-sensitive language like XML. A XAML file is saved with the .xaml extension. A .xaml file is compiled than being interpreted at runtime. The XAML compilation and run-time conversion process involves the following steps:
1. Converting XAML to the equivalent binary called Binary XAML (BAML).
2. Embedding BAML as a resource in the assembly.
3. Extracting the BAML at runtime to generate an object graph that represents the UI.
The following figure depicts the conversion of .xaml files to .baml files and embedding the resource files in the assembly.
| Translation - Chinese XAML 是基于可扩展标记语言 (XML) 的声明式标记语言。XAML 的发音是 zammel。它可以简化 .NET Framework 应用程序,如 WPF 应用程序的用户界面 (UI) 的创建。尽管如此,它不会定义控制程序流的模型。因此,链接应用程序逻辑代码和 XAML 中的标记代码就非常重要。
另外,XAML 通过使用代码隐藏文件将 UI 定义与运行时逻辑分离开来,这些文件通过分部类定义与 XAML 标记相关联。这样可使设计人员与程序员的工作分离开来。因此,实现 XAML 可让设计人员专注于设计相关的任务,而程序员负责实现应用程序逻辑。
XAML 是区分大小写的语言,和 XML 一样。XAML 文件保存为 .xaml 后缀名。.xaml 文件在运行时会被编译,而非解释。XAML 编译运行时转换过程包含以下步骤:
1. 将 XAML 转换成等效的二进制 XAML (BAML)。
2. 将 BAML 作为资源,嵌入程序集。
3. 运行时解压缩 BAML,生成表示 UI 的对象图形。
下图描述了将 .xaml 文件转换成 .baml 文件并将资源嵌入程序集的过程。
|