Introduction
Today we are explaining how to pick a contact from a contact list in Windows Store apps using C# and XAML. The contact information selected using the contact picker is available through the "ContactInformation" class. This class provides properties like, Name, PhoneNumbers, and Emails etc. This class also provides "GetThumbNailAsync()" method using that the contact image can be extracted. The Contact application on the Windows 8 synchronizes with your contacts on Windows Live, Facebook, and Linkedin etc.
In this example we are using the two namespaces "Windows.ApplicationModel.Contacts" to pick your contact from the people app and "Windows.UI.Xaml.Media.Imaging" for the image of the contact from the contacts list.
Step 1
Open Visual Studio 2012 and start a new Windows Store apps project.

Step 3
Go to Solution Explorer and double-click on "MainPage.xaml" to open it.

Step 4
Your "MainPage.xaml" page is as in the following code:
<Page
x:Class="ContactPicker.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:ContactPicker"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<Page.Resources>
<DataTemplate x:Key="contactTemplate">
<Grid Width="400" Height="200" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="200"></ColumnDefinition>
<ColumnDefinition Width="200"></ColumnDefinition>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="75"></RowDefinition>
<RowDefinition Height="75"></RowDefinition>
<RowDefinition Height="75"></RowDefinition>
</Grid.RowDefinitions>
<TextBlock Grid.Column="0" Grid.Row="0" Text="Name" FontSize="20" FontWeight="Bold"></TextBlock>
<TextBlock Grid.Column="1"
Grid.Row="0"
Text="{Binding ContactName}" FontWeight="Bold"></TextBlock>
<TextBlock Grid.Column="0"
Grid.Row="1"
Text="Contact Number"
Visibility="{Binding CanShow}" FontSize="20" FontWeight="Bold"></TextBlock>
<ListBox Grid.Column="1"
Grid.Row="1"
ItemsSource="{Binding PhoneNumbers}"
Visibility="{Binding CanShow}"></ListBox>
<TextBlock Grid.Column="0"
Grid.Row="1" Text="Image" FontSize="20" FontWeight="Bold"></TextBlock>
<Image Height="100" Width="100" Grid.Column="1" Grid.Row="1"
Source="{Binding ContactImage}" HorizontalAlignment="Left" VerticalAlignment="Center"></Image>
</Grid>
</DataTemplate>
</Page.Resources>
<Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}">
<Button x:Name="PickBtn" Content="Pick contact" HorizontalAlignment="Left" Margin="49,118,0,0" VerticalAlignment="Top" Width="200" Height="60" FontSize="22" Click="PickBtn_Click"/>
<ListView x:Name="ContactList"
HorizontalAlignment="Left" Height="500"
Margin="402,106,0,0" VerticalAlignment="Top" Width="500"
ItemTemplate="{StaticResource contactTemplate}"/>




Abidali SutharPosted Nov 22, 2013, 6:17 AM
Is it possible to add new contact in People hub from app?
TimPosted May 29, 2013, 9:18 AM
How can you get the Email address.
Prabhakar MauryaPosted Mar 8, 2013, 4:59 AM
Hello sir, No any permission require before accessing contacts. Buts must you have an Microsoft account to login people App and if you want to access Facebook contact then your Facebook account must be connected to your Microsoft account.
Mahesh ChandPosted Mar 7, 2013, 4:58 PM
Does app need some kind of permission before accessing contacts?