سؤال

Theres something about the new WinRT API and the languages that target it (either directly or indirectly) and their relationship with XAML that I dont understand.

  1. .NET languages (C#, VB.Net, F#) can be used to build XAML Metro apps that run on a 'api-restricted' CLR that in turn runs on WinRT
  2. C++ can be used to build unmanaged XAML apps that run directly on top of WinRT APIs

My question is this - does the XAML in scenario 1 get converted to BAML, and then MSIL (as per traditional .NET apps), or is there a new mechanism for this? If not, then how does the compiler building unmanaged apps convert the same XAML into native instructions? Do the two scenarios get resolved with the same compilation strategy? If so, then how?

هل كانت مفيدة؟

المحلول

In scenario 1 when writing metro apps you are no longer using the .Net XAML implementation ,System.Windows.Controls namespace, instead you are using XAML controls from Windows.UI.Xaml.Controls.

The XAML implementation in the new namespace is now part of WinRT so hence it is unmanaged. When you use these controls within a metro .Net app you are actually using Runtime Callable Wrappers for those WinRT controls.

When you are XAML in unmanaged C++ metro app you are using unamanged WinRT controls, so yes they are being compiled to native code but there is no translation from .Net to native code.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top