WinJSContrib.ContactCard (NuGet package)

This is a wrapper around the contact card API in WinRT. It allows for a more friendly way to interact with user's contacts

To use it, add a reference in your page or in default.html
<script src="/scripts/winjscontrib/mcnext.contacts.js"></script>

now you just need to call it like this :
MCNEXT.Contacts.showContact({ firstName: 'John', lastName: 'Doe', email: 'johndoe@doe.com', phone: '0123456789'}, element);

element is the DOM element used by the system to position the contact card.

You could define work/home phone/mail/addresses like this :

MCNEXT.Contacts.showContact({ 
	firstName: 'John', 
	lastName: 'Doe', 
	email: 'johndoe@doe.com', 
	phone: '0123456789',
	work: {
		email: 'johndoe@doe.com', 
		phone: '0123456789',
		address: {
			street: 'my street',
			locality: 'Paris',
			postalCode: '75002'
		}
	},
	home: {
		email: 'johndoe@doe.com', 
		phone: '0123456789'
	},
}, element);

Last edited Mar 17, 2014 at 4:49 PM by gleborgne, version 3