c# - ContactPicker is not working in Windows Phone 8.1 Silverlight -
I have tried to get contact information in Windows Phone 8.1 SL App
In my function,
Private async zero PACACContactButton_Click (Object Sender, RoutedEventArgs E) {var contactPicker = New Windows.ApplicationModel.Contacts.ContactPicker (); ContactPicker.desiredFieldsWithContactFieldType.add (Windows.ApplicationModel.Contacts.ContactFieldType.email); Contact Contact = Contact Picture. Pick contact sank (); // It throws the system. Supplemental expansion // Additional information: The method or operation is not implemented. If (contact! = Null) {...}}
The exact same function works in Windows Phone 8.1 RT. ContactPicker
class is both supported in accordance with WP 8.1 RT and WP 8.1 SL.
Any ideas what's going on?
I have this pattern was in Win 8.1 for my Universal Store app today, so be it Help you Although I had different exceptions (file not explored expletives and just plain system.expression), so I'm not really sure that this is the same issue.
As far as I use is running, it is necessary to present to the ContactPicker work:
- ContactPicker example should be made to the UI thread
- contactPicker.DesiredFieldsContactFieldType should be the exception that produce an item (0 or> 1 items)
this am what I have:
< Using code> // windows. Application mod.core; // in an async method: contact user = null; AutoResetEvent resetEvent = new AutoResetEvent (wrong); CoreApplication Main Vive Core window Dispartrkrn async (core dispatcher Preeririti. General (async () = & gt; {ContactPicker contactPicker = new Contacts Picture (); ContactPicker.DesiredFieldsWithContactFieldType.Add (ContactFieldType.PhoneNumber); user wait = contact picker. PICContactAsync ( ); ResetEvent.Set ();}); resetEvent.WaitOne (); if (user! = nULL) {// do smth}
Comments
Post a Comment