WP7 How to debug airplane mode on device?

前端 未结 3 959
悲哀的现实
悲哀的现实 2021-01-17 10:02

Is there a way to debug airplane mode on the device? I tried turning airplane mode on in the device settings and disabling the internet connection on my computer, but Networ

3条回答
  •  日久生厌
    2021-01-17 10:32

    Notice the comment on the bottom of the official doc:

    This API will always return true on the Windows Phone 7 emulator. Testing therefore requires a facade, mock or conditional chunk of code.

    I just tested this on an actual device and indeed, it returns a constant true.

    However, the thing is - it is all because you keep your phone connected to the PC and the Ethernet interface is available. Once you disconnect the phone and start the app, you will see that a False will be returned.

提交回复
热议问题