Provides access to the current app's license metadata.
The LicenseInformation class has these types of members:
The LicenseInformation class has these events.
|LicenseChanged||Raises a notification event when the status of the app's license changes.|
The LicenseInformation class inherits methods from the Object class (C#/VB/C++).
The LicenseInformation class has these properties.
|Read-only||Gets the license expiration date and time relative to the system clock.|
|Read-only||Gets the value that indicates whether the license is active.|
|Read-only||Gets the value that indicates whether the license is a trial license.|
|Read-only||Gets the associative list of licenses for the app's features that can be bought through an in-app purchase.|
You access this object through the LicenseInformation property of the CurrentAppSimulator object during testing, or the LicenseInformation property of the CurrentApp object when the app is distributed through the Windows Store.
// get current app object using the simulator interface currentApp = Windows.ApplicationModel.Store.CurrentAppSimulator; // get the license information object licenseInformation = currentApp.licenseInformation;
Note The CurrentApp object obtains its data from the Windows Store, which requires that you have a Windows Store developer account and that the app has been published in the Windows Store. If you don't have a Windows Store developer account, you can test the functions of this class by using the CurrentAppSimulator.
The following example illustrates how to get a LicenseInformation object from the simulated version of the current app. The sample also shows adding an event listener to catch changes in the license's status while the app is running.
// get current app object using the simulator interface currentApp = Windows.ApplicationModel.Store.CurrentAppSimulator; // get the license information object licenseInformation = currentApp.licenseInformation; // register license state change licenseInformation.addEventListener("licensechanged", reloadLicense);
Minimum supported client
|Windows 8 [Windows Store apps only]|
Minimum supported server
|Windows Server 2012 [Windows Store apps only]|
Minimum supported phone
|Windows Phone 8|
- Trial app and in-app purchase sample
- How to create a trial version of your app
- How to support in-app purchases
Build date: 2/25/2013