saving contact object in metro apps RRS feed

  • Question

  • I am creating a contact object at runtime in a metro app and would like to save the object back..like done in phone apps. tried using contactpickerUI but get an error on calling addcontact....

    appreciate your help on this.


    addContactResult = Windows.ApplicationModel.Contacts.Provider.ContactPickerUI().addContact(myContact.id, myContact);


    (addContactResult) {




    gets an error on above line

    0x800a13ef - JavaScript runtime error: Windows.ApplicationModel.Contacts.Provider.ContactPickerUI: type is not constructible

    any idea the reason for it.

    also like contact application on phone does metro apps stores the contact in people app or its own storage area.

    thanks & regards chandresh soni

    Tuesday, September 18, 2012 6:28 AM

All replies

  • Have you looked at this sample (Contact Picker App):


    Dave Paquette @Dave_Paquette www.davepaquette.com

    Tuesday, September 18, 2012 5:54 PM
  • yes I did but could not understand how contactPickerUI gets the control. I tried get the hold of contactPickerUI on a new blank javascript project. in my project I have default.html and default.js (standard files) and in default.js I add below code but unfortunately on ready event does not fire.


    function() {


    "use strict";




    varpage = WinJS.UI.Pages.define("/default.html", {


    function(element, uri) {


    // During an initial activation this event is called before the system splash screen is torn down.



    function(element, options) {


    // During an initial activation this event is called after the system splash screen is torn down.


    // Do any initialization work that is not related to getting the initial UI setup.

                contactPickerUI = options.contactPickerUI;



    function() {





    any idea how to get the contactPickerUI so that I could call its addContract method to add new contacts. appreciate your help again

    thanks & regards chandresh soni

    Thursday, September 20, 2012 11:39 AM