For Windows 8 ans RT, is all of the features in the JavaScript API also in the XAML/C# for Windows 8/RT development? I heard that it complements a high number of the API features, but is not 100%.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Yes and no:
As JS runs primarily on top of HTML, and JS is single-thread-only, and loosely-typed, and has a heritage based on lambdas and closure/scope passing, instead of traditional class-construction, the DOM-libraries and peculiarities are also different from those of C# + XAML.
So the question boils down to what it is you’re talking about:
If your question is:
“can I access Windows RT features in the language of my choice, through a MS-specific library?“
The answer is yes.
If your question is:
“can I do all things in JS/HTML that I can do in C#/XAML or C++?“
The answer is no.
If your question is:
“does my knowledge of WinRT method-calls/API-footprint in language X translate directly
(ie: [CTRL+X|CTRL+C],CTRL+V/verbatim), to language Y?“
The answer is no.
So the key to getting the most out of this is to know what is and is not a part of the RT specification.
XBox360 controller support, for instance:
Not supported in JS (at least not the last time I checked the spec — during dev releases).
Why not?
It’s not a supported part of WinRT, ergo, not a part of the RT library, ergo, inaccessible from the JS RT library.
But using DirectInput/XInput in C# or C++, in an RT app, you can have full support for a 360 controller.
On the other hand, all things which are actually supported in the WinRT library (file-access, webcam/audio access, Promises, etc), are available (accessible/behaving in language-specific ways) inside of the library, regardless of language, and all operate at roughly the same speed, in terms of method-calls (as each language basically has a wrapper to access C++ implementations), but not necessarily final run-time (an HTML5 canvas application of a webcam app might be slower than a C++ app… no surprise).