The documentation for ContactPicker.PickSingleContactAsync
and ContactPicker.PickMultipleContactsAsync
states that they "may" not be supported post Windows 8.1 or Windows Phone 8.1
And supported they are not. Not just deprecated but obsoleted in favour of ContactPicker.PickContactAsync
and ContactPicker.PickContactsAsync
with the old methods throwing a not-implemented exception under Windows 10.
On the heels of an answer to my last question on Stack Overflow, I read the Windows 10 documentation page for PickContactsAsync and downloaded the sample referenced at the end of that page. Running that sample under Win10, I found that:
ContactPicker.PickContactAsync
allows selection of only one contact as expected.ContactPicker.PickContactsAsync
works but allows selection of only one contact, contrary to expectations raised by the sample.
Is the behaviour of ContactPicker.PickContactsAsync
a bug soon to be corrected, a simple glitch due to the paint still drying on Windows 10, or did some genius decide to discontinue support for multiple selection of contacts?
I can write a loop so the user can pick them serially - I don't see any other option in the short term - but that's an atrocious user experience. If there's some setting or option I need to set that will magically sort things out, I'd love to hear about it.
Supporting info for good answer below
This is what the picker looks like when launched.
Where's the app bar? It's not shown. If you click or tap a contact, it is selected and the picker closes. It's only when you click "Select a contact" that it appears, like so:
If you then click on the list-with-ticks glyph, suddenly the UI changes to this:
This is easy once you know how, and ridiculously hard to discover. This is a undoubtedly a remnant of the haptomanic paroxysm known as Windows 8.
Other casualties include the Shift and Ctrl key that once permitted range and multi-select in a mouse/keyboard environment. These behaviours were implemented by the Windows ListBox, which the Common Dialogs used. Presumably the new UI doesn't use a ListBox.
Some unsolicited advice for Microsoft
The whole point of free upgrades to Windows 10 is to anchor it in the home because that achieves two things.
- People used to Windows at home will want it in the workplace.
- It indoctrinates the young. You can't leave them alone with Apple. That's just creepy.
UX disasters like the one considered here will undo your good work. Contact picker is the new Common Dialogs. It affects everything. This is where you have the most leverage for a producing a good UX despite the follies of app developers.
Here's what I think you should do: when the contact picker is invoked via PickContactsAsync, open it already in multi-select mode.
And another thing
While I'm dumping on Microsoft, there's also a bug in the sample. In Scenario2_PickContacts.xaml.cs
this line
if (this.contacts.Count > 0)
should read
if (this.contacts != null && this.contacts.Count > 0)
because if you don't pick anything, this.contacts
is null and it barfs.
PickContactsAsync
can select multiple contacts, but the UI for it is kind of hidden. You need to click the "Select" button in the app bar. (Looks like a list with check boxes.)