📜 ⬆️ ⬇️

A bit of XAML. 0

To begin with, what is XAML .
Xaml (pronounced zaml) stans for Xtensible Application Markup language. In essence, it is a subset of XML that allows you to describe a user interface and its logic. In fairness it should be noted that initially the acronym was eXtensible Avalon Markup Lang, but it coincided :). Xaml, in fact, is an open thing, but we are now interested in it as the basis for the work of the new presentation system and the Microsoft Windows Presentation Foundation interfaces.

What is it all for
Experience in developing applications has long shown to everyone that it would be nice not to mix the logic of code and the logic of presentation (data). Partly because it makes development easier, partly because it is very harmful (for end users) to force programmers to write user interfaces. A good interface is half the battle, but you have to come up with it, and make it portable , and change it separately from logic, and optimize it for the audience, and ... well, it's in demand.
Yes, this miracle has analogues: XUL, UIML, Adobe Flash + Flex, Adobe Apollo and something else.

How it works
XAML, a declarative markup language, allows you to tell the system exactly what interface components we want to see. In the standard package there are both complete controls (listbox, button, etc), as well as presets / software templates for inheritance and creating your own (ContentPresenter, Control, etc). The framework application, PresentationHost (or ApplicationHost, if we are talking about the browser) gets a description of the scene and tries to display it with the help of system tools, complementing the missing data and actually managing the process. By the way, there are no window handles and there cannot be any.
')
XML-base allows you to describe very serious and deep sets of interface elements. For example, no one can prevent me from creating a drawing area (Grid) inside the behavior for the button, which will be shown when you hover the mouse, and on the Grid to put the video in a three-dimensional plane. And set all this relative sizes. The concepts of controls are very, very conditional, and I can easily show video on a three-dimensional torus rotating inside some area; and for the programmer - attention! - it will be standard (equivalent to standard) ListBox ... in general, I will show.

Where to use it (software and hardware)
Microsoft says WPF works wherever NETfx3 comes up. This is a bit exaggerated.

Currently, all this works more or less on Vista, as well as in a limited way on Win XP SP2 and the server. Anticipating questions: no, only SP2 or SP1 for the server. The application host (integration of xaml as a system scripting language) will not work on XPSP2, but in general, nothing.

Iron: a normal modern computer will be enough . Knowing that now this phrase has caused many nervous laughter :), I will explain. According to my observations, you should not try to run all this household, if a) the RAM is less than 128M, b) the video memory is less than 8M, c) the processor frequency is less than 1-1.2GHz. It, by the way, will work anyway, but it will work very well, really sad.
By the way, graphic acceleration due to the video card can be significantly achieved only on WinVista. DirectX functions are used for all video outputs if they do not work - software wrapper. It does not work, by experience - often.

Immediately I say that I do not use Vista so far, and all the examples will be on XPSP2 / WSSP1. If you use - it's easier for you :)
Nobody said it was easy. But it will be beautiful ...



Let's define what we may need for a practical acquaintance with the technology :

- for the presentation host itself, we cannot do without the .NET framework 3.0 (51M). This is a link to the full package, saving traffic can take the standard 2.8M installer . Those who have Vista RC1 or Vista RTM may not download this link, you already have it all.

- for visual work with scenes, we need MS Expression Interactive Designer (7.1M). This is a CTP version. By the way, it is not necessary to register, if you say “no, thanks” below (just like in that joke :). This thing can compile / build projects and work with xaml-code to a limited extent. By the way, it is itself partly written in XAML, which will be an opportunity to be convinced.

- not required, but Visual Studio or its express version will be useful. They who do not know are free. PHP-shnikom recommend CSharp, the rest - decide for yourself. The installer merges 40-60 meters, if you need an iso-person - here (450-500M).

- in order to work in the Studio with WPF-projects, you need to install extensions for WPF + WCF (4.0M).

Currently, XAML and related technologies are still being developed. However, live apps are gradually appearing, like the one in the NewYork Times Reader picture. In addition to the obvious presence due to the “technology race”, there are really serious innovations for both the user and the development team (designer + programmer).

Taken to LJ cgvictor 'a, with the permission of the author.

If anyone is interested, I will post here fresh articles from his blog on this topic.

Source: https://habr.com/ru/post/808/


All Articles