locked
How to create Windows Runtime Component in Javascript? RRS feed

  • Question

  • Hi All,

    Is there any provision to create Windows Runtime component using Javascript language? I have Javascript library, Now I want to consume it on C#. Please advice me.

    Thanks,

    Pallam Madhukar 


    Pallam Madhukar Windows Phone Developer

    Wednesday, July 13, 2016 9:29 AM

Answers

  • No, Javascript is not supported as a language for Windows Runtime Components 

    "By using the Windows Runtime, you can create components (essentially DLLs) in C++, C#, or Visual Basic," from the official documentation .

    What you can do, if you want to execute your JS code in your UWP/WPF app is to load it in a WebView and execute the code there. The resource from @Muipo's response is pretty good at illustrating how to do that and can show you can roll your own Bridge if you don't want to use a 3rd Party

    • Proposed as answer by Jayden Gu Wednesday, July 27, 2016 9:27 AM
    • Marked as answer by Barry Wang Thursday, July 28, 2016 1:53 AM
    Wednesday, July 13, 2016 1:35 PM

All replies

  • Wednesday, July 13, 2016 10:08 AM
  • No, Javascript is not supported as a language for Windows Runtime Components 

    "By using the Windows Runtime, you can create components (essentially DLLs) in C++, C#, or Visual Basic," from the official documentation .

    What you can do, if you want to execute your JS code in your UWP/WPF app is to load it in a WebView and execute the code there. The resource from @Muipo's response is pretty good at illustrating how to do that and can show you can roll your own Bridge if you don't want to use a 3rd Party

    • Proposed as answer by Jayden Gu Wednesday, July 27, 2016 9:27 AM
    • Marked as answer by Barry Wang Thursday, July 28, 2016 1:53 AM
    Wednesday, July 13, 2016 1:35 PM