문제

I would like to ask if it is possible to add an option in the Settings charm to toggle the airplane mode in a Windows 8 application.

Thanks in advance!

도움이 되었습니까?

해결책

Please see my answer at How to check/switch the airplane mode programmatically in Windows 8?:

Unfortunately, there isn't a programmatic way for Metro apps to change the airplane mode in Windows 8. It is against the Metro guidelines for an application to go outside its sandbox and modify system settings like this without user permission (see the discussion at http://social.msdn.microsoft.com/Forums/en-US/winappswithcsharp/thread/1ad10725-b1b8-4723-b2c3-861900809e02).

Now, you may be able to figure out the status by using some of the functionality in the Windows.Networking.NetworkOperators namespace. Specifically, check out the MobileBroadbandRadioState and NetworkDeviceStatus enumerations.

Or, you could prompt the user to make the change by explaining how to access the setting using Windows Key + I, Change PC Settings, Wireless, Airplane Mode.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top