I'm trying to use Windows Runtime Component (C#) in my Windows 10 Universal App (JavaScript). I found how to do that in Windows 8.x store apps: https://msdn.microsoft.com/en-us/library/hh779077.aspx but this solution is not working with Windows 10 Universal App. It is throwing exception that class is not registered in the JavaScript.
WRC code:
namespace SampleComponent
{
public sealed class Example
{
public static string GetAnswer()
{
return "The answer is 42.";
}
public int SampleProperty { get; set; }
}
}
In JS:
document.getElementById('output').innerHTML =
SampleComponent.Example.getAnswer();