Abstracting the LicenseInformation Class

The downloadable sample code includes a custom ILicenseService interface, which contains a single property called Trial, indicating the trial state of the app. There are two implementations of this interface: one for testing and one for production.

The production implementation named LicensingService wraps a LicenseInformation instance, as shown in the following excerpt:

public class LicensingService : ILicensingService{    public bool Trial    {        get        {            LicenseInformation licenseInformation                                    = new LicenseInformation();            return licenseInformation.IsTrial();        }    }}

During development and testing, the ...

Get Windows® Phone 8 Unleashed now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.