How to detect Kids Corner Programmatically in Windows Phone 8?

The Kids Corner is one of the new feature that is introduced with the Windows Phone 8. If you encounter a scenario where you want to detect the mode of the current application like Default or Kids Corner and take actions accordingly, you can use the ApplicationProfile class.

How to detect Kids Corner Programmatically in Windows Phone 8?

The ApplicationProfile class exposes the property static property called “Modes” (ApplicationProfile.Modes) which returns one of the below modes

1. Default – This is the default mode in which the Windows Phone Application runs

2. Alternate – This is the mode where the Windows Phone Application runs in the Kids’ Corner mode.

The ApplicationProfile class is defined in the name space Windows.Phone.ApplicationModel. Hence, you should add the reference to the name space in the code behind.

Using Windows.Phone.ApplicationModel

Below is a sample code to demonstrate How to detect Kids Corner Programmatically in Windows Phone 8?

Code behind Page

using System;

using System.Collections.Generic;

using System.Linq;

using System.Net;

using System.Windows;

using System.Windows.Controls;

using System.Windows.Navigation;

using Microsoft.Phone.Controls;

using Microsoft.Phone.Shell;

using PhoneApp1.Resources;

using Windows.Phone.ApplicationModel;

namespace PhoneApp1


public partial class MainPage : PhoneApplicationPage


// Constructor

public MainPage()




private void Button_Click_1(object sender, RoutedEventArgs e)


string ApplicationMode = ApplicationProfile.Modes.ToString();

textbox1.Text = ApplicationMode;














FontFamily="{StaticResource PhoneFontFamilyNormal}"

FontSize="{StaticResource PhoneFontSizeNormal}"

Foreground="{StaticResource PhoneForegroundBrush}"

SupportedOrientations="Portrait" Orientation="Portrait"


<!--LayoutRoot is the root grid where all page content is placed-->

<Grid x:Name="LayoutRoot" Background="Transparent">


<RowDefinition Height="Auto"/>

<RowDefinition Height="*"/>


<!--TitlePanel contains the name of the application and page title-->

<StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">

<TextBlock Text="@isenthil" Style="{StaticResource PhoneTextNormalStyle}" Margin="12,0"/>

<TextBlock Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}">

<Run FontSize="48" Text="MobileOSGeek"/>



<!--ContentPanel - place additional content here-->

<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">

<Button Content="Mode" HorizontalAlignment="Left" Height="105" Margin="58,84,0,0" VerticalAlignment="Top" Width="343" Click="Button_Click_1"/>

<TextBox x:Name="textbox1" HorizontalAlignment="Left" Height="80" Margin="10,231,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="436"/>

<TextBlock HorizontalAlignment="Left" Margin="27,204,0,0" TextWrapping="Wrap" Text="Current Mode" VerticalAlignment="Top"/>