Reputation: 4283
It's Windows Phone 8.1 Universal.
I need to be able to select and deselect items in the listview. I can't select/deselect a single item programmatically, but I can select all items in the listView with this method:
listView.SelectAll();
It would make sense to expect the exact opposite method built-in to deselect all, but there is none.
I can't use the following code because it's not bound to a list of ListItem object, but a custom object
foreach (var item in listView.SelectedItems)
{
//item.IsSelected isn't available because it's a custom object
}
How do I deselect all items in the listview?
Upvotes: 0
Views: 139
Reputation: 4283
If figured it. The following code deselects all items in the listView:
listView.SelectedItems.Clear();
Upvotes: 1