The sample illustrates the use of the ApplicationProfile.Modes property. When the app runs, it checks this property and if the value is ApplicationProfileModes.Alternate, then the app is running in Kid’s Corner mode. Depending on the content of your app, you may want to change its appearance or behavior when it is running in Kid’s Corner. Some features that you should consider disabling when running in Kid’s Corner include in-app purchases, launching the web browser, and the ad control.

To illustrate this feature, this sample app makes changes to the following UI elements.

  • TextBlock – The text is updated to indicate whether the app is currently in Kid’s Corner mode.

  • Checkbox – This checkbox is data bound to a value in isolated storage settings. It allows you to specify whether the Button control in the UI should be disabled in Kid’s Corner. The checkbox itself is hidden when running in Kid’s Corner.

  • Button – This button, when enabled, simply launches a message box. If the checkbox was checked while the app was running in normal mode, the button is disabled when running in Kid’s Corner.

For more info about this feature, see Kids Corner for Windows Phone.

Build the sample

  1. Start Visual Studio Express 2012 for Windows Phone and select File > Open > Project/Solution.

  2. Go to the directory in which you unzipped the sample. Double-click the Visual Studio Express 2012 for Windows Phone solution (.sln) file.

  3. Use Build > Rebuild Solution to build the sample.

Run the sample in normal mode

  • To debug the app and then run it, press F5 or use Debug > Start Debugging. To run the app without debugging, press Ctrl+F5 or use Debug > Start Without Debugging.

Test the sample in Kid’s Corner mode

  1. On the device or emulator, go to Settings and select Kid’s Corner.

  2. Make sure the Kid’s Corner slider is set to On.

  3. Tap Apps and select your app from the list to allow it to be launched in Kid’s Corner. You can tap launch kid’s corner from this screen to go immediately into Kid’s Corner mode.

  4. To enter Kid’s Corner mode without going to the settings page, engage your lock screen by pressing the power button on your phone twice or, on the emulator, press the F12 key twice. When the lock screen appears, swipe to the left to enter Kid’s Corner mode.

  5. You can launch your app by tapping its tile or you can debug your app using Visual Studio.

  6. To return to normal phone mode, bring up the lock screen by tapping the power button or F12 twice and then swipe up.

See also