[Program] RIA (Rich Internet Application) Microsoft Avalon and XAML

xiaoxiao2021-03-06  31

1. What is Avalon?

Avalon is part of the next version of Windows (Cycord "longhorn"), is a graphics and display engine, mainly composed of a set of classes in the new .NET framework.

2. What is XAML?

Avalon defines a new tag language used in Longhorn, which is code to "XAML" (Extended Application Markup). You can use XAML to define the layout of text, images, and controls, which is very similar to using HTML. Most writes Avalon applications may contain both program code and XAML. You will use XAML to define the initial visual interface of the application and write code used to implement other functions. You can embed the program code directly into XAML, or you can keep it in a separate file. All functions that can be implemented with XAML can be implemented by program code. Therefore, there is no need to write programs at all without using any XAML. However, it will not be possible; many tasks can only be completed by the program code, so only the simplest application will only include XAML.

With the XAML element, you can control the layout of each page, including the display of text and images, insert buttons, text boxes, and the like interactive components. In summary, XAML is a language used to present a user interface that makes a page that makes an application in a declaration. Of course, in addition to using XAML, you can also use the process code to write longhorn applications. In general, a Longhorn successful application will have XAML pages and managed process code at the same time. You can combine them in your own way, but any combination of both is acceptable.

3. How does Avalon and Xaml work?

Let's take a look at an XAML code, which is the most classic "Hello World" program. The following code is stored into helloworld.xaml.

Background = "blanchedalmond"

Fontfamily = "COMIC SANS MS"

FONTSIZE = "

36PT

"

Horizontalalignment = "center">

Hello, World!

Because there is no code, you can load the helloWorld.xaml file directly into the LONGHORN version of Microsoft Internet Explorer, and then you will see content similar to a web page. You can also use a program called MSBuild to compile HelloWorld.xaml. Two other short files are required for this compile time (not shown here). One of the extensions that extends Proj or MsProj will provide some information about the program and list all the required source files (XAML, and other files). Another XAML short file is also required to indicate which XAML page appears when executing the program. Run the executable of Hello World, you will see a content similar to the Windows program. Figure 1 shows these two versions.

Figure 1 Hello World as a page and as a program

In a sense, XAML and HTML pages are very similar, but because it is based on XML, it has a stricter specification, while the entire operating system of Longhorn has become its container because of the IE because it is executed under Avalon. It has a broader space.

转载请注明原文地址:https://www.9cbs.com/read-80138.html

New Post(0)