Unanswered ContactPicker.PickMultipleContactsAsync

  • Tuesday, October 25, 2011 4:51 PM
     
      Has Code

    I'm trying to consume the PickMultipleContactsAsync method of the ContactPicker in VB, but am running into an issue because the return type from the PickMultipleContactsOperation's GetResults operation returns an IReadOnlyList(Of IContactInformation). IContactInformation is internal to the Contacts namespace and as such is not available to calling code. I noticed that the return type for PickSingleContactAsync is a ContactInformation which is public. Is there an issue with the PickMultipleContactsOperation, or in the metadata for this method with the current build or is there another intended means of using the PickMultipleContactsAsync than:

    Dim picker As New ContactPicker
    Dim contacts = Await picker.PickMultipleContactsAsync()
    For Each contact in contacts
        ' Compiler error because contact is an internal/friend IContactInformation type
    Next

     


    http://www.ThinqLinq.com http://www.LinqInAction.net - "LINQ In Action", The book is now available. Don't wait for the movie

All Replies

  • Wednesday, October 26, 2011 1:59 AM
    Moderator
     
     

    Hi Jim,

    Thanks for pointing this out.  I'm seeing similar behavior to what you describe from .Net; however, PickMultipleContacts can be called successfully from JavaScript.  I'm not sure exactly why it's different (it may be because of stronger typing in the .Net projection).  I can't check if this is known at the moment, but will try to do so tomorrow.  You can also file this yourself via the feedback tool or connect.

    --Rob 

  • Wednesday, October 26, 2011 1:55 PM
     
     

    Ok. I submitted it, hopefully in the right area. I didn't see a connect area for general WinRT metadata errors.


    http://www.ThinqLinq.com http://www.LinqInAction.net - "LINQ In Action", The book is now available. Don't wait for the movie
  • Wednesday, November 09, 2011 7:37 PM
     
      Has Code

    What's the compiler error? If you can call the method, something like this might work:

    Dim picker As New ContactPicker
    Dim rawContacts As IEnumerable = Await picker.PickMultipleContactsAsync()
    Dim contacts = rawContacts.Cast(Of ContactInformation)()
    For Each contact in contacts
        ' ...
    Next