I am trying to use math.js in my UWP app using ChakraBridge library. I referred the following link to use a javascript framework in a UWP app. http://www.codeproject.com/Articles/1060634/Using-JavaScript-frameworks-from-your-Csharp-UWP-a
But I am unable to figure out how to inject a javascirpt framework into Chakra context. The link says use the method "ReadAndExecute" or "DownloadAndExecute", but I could not find those methods in any of the classes of ChakraBridge library. So how do I inject *.js files into ChakraBridge context?
The two methods should be defined by coder. They are documented in ChakraBridge GitHub Site. And they look like below:
So, to register *.js files into ChakraBridge context. Simply call these two methods like below:
And here is the link to a basic demo I made:ChakraBridgeSample
Notes:
The behavior of registering CommunicationManager.OnObjectReceived event is a little different from GitHub Documentation. There is no Type argument anymore(only data argument). So in javascript side,sendToHost function should look like below: