O'Reilly logo

Windows® Phone 8 Unleashed by Daniel Vaughan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Inversion of Control (IoC)

Windows Phone presents some interesting challenges for testing apps in various deployment scenarios. For example, a common requirement for phone apps is the need to behave differently depending on whether the app has been purchased or is in trial mode. Furthermore, the launcher and chooser API does not play well with unit tests because launchers and choosers cause the app to be deactivated. Hence, there is a need for some mechanism to alter the behavior of an app, depending on its deployment scenario, and to decouple and replace various phone-specific types so that code can be more easily tested. One way to achieve these things is by using Inversion of Control (IoC).

IoC encompasses two key concepts presented in this ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required