Introduced
Unique device for Windows Phone 7.5 (SDK 7.1)
Get contact-related data
Get calendar-related data
Example
1, show how to get contact data
ContactPictureConverter.cs
Using System;
Using System.Net;
Using System.Windows;
Using System.Windows.Controls;
Using System.Windows.Documents;
Using System.Windows.Ink;
Using System.Windows.Input;
Using System.Windows.Media;
Using System.Windows.Media.Animation;
Using System.Windows.Shapes;
Using Microsoft.Phone.UserData;
Using System.IO;
Using Microsoft.phone;
Namespace Demo.contactsandcalendar {public class ContactPictureConverter:System.Windows.Data.IValueConverter {//Extract picture from contact, convert picture to WriteableBitmap type object and return public object convert (object value, type TargetType
, object parameter, System.Globalization.CultureInfo culture) {Contact contacts = value as contact;
if (contact = = null) return null; Converts the contact picture to an object of type WriteableBitmap and returns this object Stream ImageStream = Contacts.
Getpicture (); if (ImageStream!= null) return Picturedecoder.decodejpeg (ImageSTream);
return null; The public object Convertback (object value, Type targettype, object parameter, System.Globalization.CultureInfo
Culture) {throw new NotImplementedException (); }
}
}