WinRT XAML - managed and unmanaged - how does it work?

Something about the new WinRT API and the languages ​​that target it (directly or indirectly) and their relationship with XAML that I don’t understand.

  • The .NET languages ​​(C #, VB.Net, F #) can be used to create XAML Metro applications that run in the CLR with an "api" restriction, which, in turn, runs on WinRT
  • C ++ can be used to create unmanaged XAML applications that run directly on the top of WinRT API

My question is this: Does XAML convert to script 1 in BAML and then MSIL (according to traditional .NET applications) or is there a new mechanism for this? If not, how does the compiler creating unmanaged applications convert the same XAML to its own instructions? Are two scenarios allowed with the same compilation strategy? If so, how?

+4
source share
1 answer

In Scenario 1, when writing subway applications, you no longer use the .Net XAML implementation, the System.Windows.Controls namespace, instead you use the XAML controls from Windows.UI.Xaml.Controls.

The implementation of XAML in the new namespace is now part of WinRT, so it is unmanageable. When you use these controls in a .Net metro application, you are actually using Runtime Callable Wrappers for these WinRT controls.

When you are XAML in an unmanaged C ++ metro application, you use unused WinRT controls, so yes, they are compiled into native code, but there is no translation from .Net to native code.

+6
source

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


All Articles