📜 ⬆️ ⬇️

Using Windows Features in Silverlight Applications

With the release of Silverlight 4, developers have the opportunity to create trusted applications that can make calls to the Windows COM subsystem. This allows you to extend the functionality of Silverlight applications in an almost unlimited way. Everything would be fine, but there are few examples of such use and implementations, and most likely they cause the most necessary things in applications, in the form of libraries they are not released. Therefore, Microsoft has released Silverlight wrappers over the most interesting features of COM.

The set of these components is called Native Extensions for Microsoft Silverlight and they are published at this address: http://code.msdn.microsoft.com/nesl along with the source code.
The main part of these components includes the following features:

Installation


NESL itself comes in the form of 5 corresponding dlls that must be on the client: SLWindowsShim.dll, SLTaskbarShim.dll, SLEncodeShim.dll, SLSensorShim.dll, SLWPDShim.dll. Note that calling COM methods from a Silverlight application is available only to desktop applications (Out of Browser). But this does not mean that the user now needs to ensure that these components are installed on the local machine.
In the scenario when the user first accesses the Silverlight application containing calls to NESL, the developer has the ability to check and install the NESL components using special helpers:


Examples of using


Along with the source code, the NESL component is provided with several usage examples.
Video Travel Journal is an application that writes video from a connected video camera in H.264 format (MP4 container) to a local file. At the same time, it is also integrated with Facebook, Bing Maps and has advanced items in the Windows7 taskbar.


Where's Teddy - an animated children's book with voice control. It uses the TTS engine of Windows7 and supports navigation commands between parts of the history of the book. In addition, two sensors, an accelerometer and an illumination sensor that react to changes, are analyzed.
')

Conclusion


If you are developing a Silverlight application that will function in a desktop mode (Out of Browser), then you will probably want to use additional functions of the operating system. NESL is the component that will solve this problem in a simple way.

Source: https://habr.com/ru/post/109738/


All Articles