Monday, October 8, 2012

How to link to a specific system-setting in your Windows Phone app?

How to link to a specific system-setting in your Windows Phone app?

I was wondering if it would be possible to hook a button up to a specific setting..

For example: 1. User starts app that uses GPS. 2. The GPS is turned off. A messagebox appears with a message saying that the GPS is turned off and a button. 3. The user taps on the button, and the "location settings" is being launched. 4. The user can switch on the GPS, and goes back to the app.

This would be a more convenient way to change settings, and it saves the user some time.

I think I saw it in an app, but I'm not sure which one. It could be Nokia Maps or Nokia Drive, but as an OEM Nokia is able to manipulate some system settings.

Is this possible?

Kind regards, Niels

Answers & Comments...

Answer: 1

Yes and no since Mango there is a way to access settings, found it here: windows phone 7 how to navigate to settings menu msdn link: http://msdn.microsoft.com/en-us/library/hh394011%28VS.92%29.aspx

using:

ConnectionSettingsTask connectionSettingsTask = new ConnectionSettingsTask(); connectionSettingsTask.ConnectionSettingsType = ConnectionSettingsType.WiFi; connectionSettingsTask.Show(); 

It seems here only:

WiFi

Bluetooth

Cellular

AirplaneMode

are available. http://msdn.microsoft.com/en-us/library/microsoft.phone.tasks.connectionsettingstype(v=vs.92).aspx

by : that_guyhttp://stackoverflow.com/users/1174574

Answer: 2

I had to do pretty much the same thing. I used toolkit:ToggleSwitch so i can change setting myself. And then you sample subscribe for its events :

this.m_ToggleSwitchUseGPS.Checked += new EventHandler<RoutedEventArgs>(ToggleSwitchUseGPS_StateChanged);

this.m_ToggleSwitchUseGPS.Unchecked += new EventHandler<RoutedEventArgs>(ToggleSwitchUseGPS_StateChanged);

Looked this

by : radoslafhttp://stackoverflow.com/users/1582088




No comments:

Post a Comment

Send us your comment related to the topic mentioned on the blog