Question

Is it possible to access the Windows 7 Sensor and Location platform from Silverlight? In particular I would like to know about the location data (GPS) and the ambient light sensor.

Edit: I would assume that the way to do this would be with C# in the code behind file.

Was it helpful?

Solution 3

With the new features in Silverlight 4, specifically out of browser and com-inter-op this is definitely possible.

I still don't know about Silverlight 3.

OTHER TIPS

No. Silverlight is supposed to be cross-platform and the Sensor and Location stuff in Win7 is not available anywhere other than Win7. You could try some complicated mix of Silverlight + .NET, but then it would be silly to use Silverlight when the whole .NET/WPF platform is available.

The Silverlight security model is explained (somewhat) here http://blogs.msdn.com/shawnfa/archive/2007/05/09/the-silverlight-security-model.aspx

The Win7 Sensor API is a native API and from .NET requires P/Invoke calls, this in a silverlight context is referred to as critical code (IMO very poorly named, but there you have it) and needs to be in an intermediate layer, so it should be doable but will not be portable.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top