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"/>




Leave a Reply


Related Posts

Free eBook on Microsoft Azure Essentials: Fundamentals of Azure
If you are one of the users who wants to learn about Microsoft Azure , here's one of the free book on Microsoft Azure Essentials: Fundamentals of...
Download Pokkiri Pongal Game for Windows Phone and Android Devices
Few days back , Skytou Games had released a game "Pokkiri Pongal" for android and Windows Phone devices . Pongal being one of the biggest fest...
Windows Phone 8.1 and Windows Runtime Apps How to #17 - Detect current User Location
This article will demonstrate in simple steps in how to detect the current location of the use from a Windows Phone 8.1 App. Retrieving the cu...
powered by RelatedPosts