On my MainPage I have multiple ListViews and GridViews with different bits of a whole set of items however some items exist in multiple Views, so when my user selects or deselects one of these items I want that item in other views to also be selected
or deselected. However all of these views have a multiple selection mode so I am struggling to do this.
Here's what I'm trying to do:
if (!GridView.SelectedItems.Contains(selectedItem))
{
GridView.SelectedItems.Add(selectedItem);
}
else
{
GridView.SelectedItems.Remove(selectedItem);
}
However this throws a 'catastrophic error' on either of these two lines of code.
From what I've read on this I understand that SelectedItems is read only and so cannot be added to or removed from like this hence the error, so I was wondering if anyone can think of another way of doing this?
I'm relatively inexperienced at this so keep the solutions simple please :) sample code would be awesome
Thanks