TimeParadox
TimeParadox

Reputation: 139

how to enable location service from my aplication on WP7

I'm writing an application for some Geolocalization.

How can i programmatically enable / disable location service from my application? like a settings page into my personal application ?

Upvotes: 1

Views: 1143

Answers (1)

Paul Diston
Paul Diston

Reputation: 3294

In your application you should try and use the Location service (GeoCoordinateWatcher), you should then check the Permission property, if this is set to Denied then this means that the user has, externally to your application, disabled location services on their phone therefore this is all you need to be concerned with. You can display a friendly message telling the user that certain features within your application will not be available but you leave the decision, to enable location services, up to the user.

The following article details the watcher_StatusChanged event handler, which includes the above check :-

http://msdn.microsoft.com/en-us/library/ff431782%28v=vs.92%29.aspx

Upvotes: 2

Related Questions