I'm writing a Metro Style C#/XAML application which connects to Bluetooth Low Energy device and recieves data from it. Microsoft shared a sample which uses WPD API and makes all what I need. But it is written in javascript and uses javascript specific methods like ActiveXObject().
var deviceFactory = new ActiveXObject("PortableDeviceAutomation.Factory");
Is there any way to port this code to C# Metro application?