×
Namespaces

Variants
Actions

How to detect if an app is running in Kid’s Corner

From Nokia Developer Wiki
Jump to: navigation, search

This article explains how to programmatically detect whether an application is running in Kids mode on Windows Phone 8.

WP Metro Icon WP8.png
SignpostIcon Code 52.png
Article Metadata
Code ExampleTested with
SDK: Windows Phone 8.0 SDK
Devices(s): Lumia 920
Compatibility
Platform(s): Windows Phone 8.0
Windows Phone 8
Article
Created: yan_ (20 Mar 2013)
Last edited: hamishwillee (04 Jul 2013)

Contents

Overview

Windows Phone 8 introduces Kid's Corner, a device mode where children can only access games, apps, videos and music that the owner approves - without risk to other important content like the address book.

Apps can make themselves more "Kid's Corner Friendly" by configuring available content, features and functionality when running in this mode. For example, this could include changing graphics, hiding menu options for in-app purchase and selecting appropriate advertisements.

This article shows how you can detect that the app is running in Alternate mode (Kids Corner).

Solution

The static property Modes of Windows.Phone.ApplicationModel.ApplicationProfile class can be used to detect if an application is running in kid’s corner mode.

This property returns an enum ApplicationProfileModes value. This enum has two members :

  • Default : application is running normally.
  • Alternate : application is running in Kid’s Corner mode.


To test the running mode, you can use this simple function :

using Windows.Phone.ApplicationModel; //required namespace
 
...
 
bool RunInKidsCornerMode()
{
return ApplicationProfile.Modes == ApplicationProfileModes.Alternate;
}

Test code

A code example/test code can be downloaded from here: Media:TestKidsCorner.zip

The example app simply uses the previous function to display the text “Run in Normal mode” or “Run in kid's corner mode”.

References

This page was last modified on 4 July 2013, at 08:52.
122 page views in the last 30 days.
×