RetailInfo
RetailInfo
RetailInfo
RetailInfo
Class
Definition
A utility class that supports one method, IsDemoModeEnabled, and one property, Properties. Call IsDemoModeEnabled to determine whether the device where the app is running has specifically enabled its retail demo mode.
public : static class RetailInfopublic static class RetailInfoPublic Static Class RetailInfo// You can use this class in JavaScript.
- Attributes
| Device family |
Windows Desktop Extension SDK (introduced v10.0.10240.0)
Windows Mobile Extension SDK (introduced v10.0.10240.0)
|
| API contract |
Windows.System.Profile.ProfileRetailInfoContract (introduced v1)
|
Remarks
If RetailInfo.IsDemoModeEnabled returns true, you can get the set of available properties from RetailInfo.Properties. These properties include specific information that is useful for pre-installed demo apps that run in a retail setting. For example, you can get a ManufacturerName, ScreenSize, and so on, and display that info in an app that's intended for retail demo. The strings returned are typically suitable for inclusion in a UI.
When possible, use RetailInfo instead of the previous Windows.Phone.System.Profile.RetailMode API. RetailMode is only available for Windows Phone and doesn't support a "Properties" set of device-specific properties.
Properties
IsDemoModeEnabled IsDemoModeEnabled IsDemoModeEnabled IsDemoModeEnabled
Determines whether the device where the app is running has specifically enabled its retail demo mode.
public : static PlatForm::Boolean IsDemoModeEnabled { get; }public static bool IsDemoModeEnabled { get; }Public Static ReadOnly Property IsDemoModeEnabled As bool// You can use this property in JavaScript.
- Value
- PlatForm::Boolean bool bool bool
true if the device where the app is running has specifically enabled its retail demo mode, otherwise false.
Properties Properties Properties Properties
Gets an object that represents the set of available retail demo properties and their values.
public : static IMapView<string, object> Properties { get; }public static IReadOnlyDictionary<string, object> Properties { get; }Public Static ReadOnly Property Properties As IReadOnlyDictionary<string, object>// You can use this property in JavaScript.
- Value
- IMapView<PlatForm::String, PlatForm::Object> IReadOnlyDictionary<string, object> IReadOnlyDictionary<string, object> IReadOnlyDictionary<string, object>
A read-only collection of key-value pairs, each pair representing an available retail demo property. This is an instance of a collection interface, not a strongly typed collection, so use the interface APIs to work with the items.
Remarks
These properties include specific information that is useful for apps that are running or otherwise available as pre-installed demo apps in a retail setting. For example, you can get a ManufacturerName, ScreenSize, and so on.
If IsDemoModeEnabled is false, Properties might contain a zero-length collection or null. Verify that IsDemoModeEnabled is true before getting the Properties value.
Once you have a valid collection, this collection is a map/dictionary where each property is identified by a property name. These property names are predefined, and each known property name is represented by a static string property of the KnownRetailInfoProperties class. So whenever you attempt to get a specific property, use a KnownRetailInfoProperties property to supply the string key value, rather than hard-coded strings. That will assure you aren't asking for values that don't exist in the collection.
The collection is represented by a different interface/object depending on which programming language you are using.
- If you're using .NET code, the collection is an IReadOnlyDictionary instance, with string keys and nominally untyped (Object) values. Use the Item indexer or TryGetValue to get the values of specific properties. Always use KnownRetailInfoProperties properties to specify the key parameters.
- If you're using C++/CX, the collection is an IMapView(String, Object) instance, which can be used as Platform::Collections::MapView. It has string keys and nominally untyped (Platform::Object) values. Use Lookup to get the values of specific properties. Always use KnownRetailInfoProperties properties to specify the key parameters.
- If you're using JavaScript, the object represents IMapView API with string keys and untyped values. Use Lookup to get the values of specific properties.
The values you get for the properties are technically untyped objects (variants) because they are being reported directly from registry info (HKLM). Here are the types that you can use as type-casting options (which might be needed for UI display) for each of the properties:
| BatteryLifeDescription | String |
| DisplayDescription | String |
| DisplayModelName | String |
| FormFactor | String |
| FrontCameraDescription | String |
| GraphicsDescription | String |
| HasNfc | Boolean |
| HasOpticalDrive | Boolean |
| HasSdSlot | Boolean |
| IsFeatured | Boolean |
| IsOfficeInstalled | Boolean |
| ManufacturerName | String |
| Memory | String |
| ModelName | String |
| Price | Double |
| ProcessorDescription | String |
| RearCameraDescription | String |
| RetailAccessCode | String |
| ScreenSize | String |
| StorageDescription | String |
| Weight | String |
| WindowsEdition | String |