When you have a ListView
in Windows 8 Metro Style Apps how can you get all the indexes selected supposing you have multiple selection enabled?
void itemsChanged (Platform::Object^ sender,
Windows::UI::Xaml::Controls::Controls::SelectionChangedEventArgs^ e
{
// get selected indexes
}
You would have to compare the SelectedItems property of the sender (the ListView) with the Items property. It appears that SelectedItems add to the collection and remove from the collection in the order items were selected (although this is not documented anywhere I can find).
You could add index properties to the type of item you bind to your ListView
. Other than that - perhaps you don't really need an index?
I found a solution with the suggestions received
auto v = itemsListView->SelectedItems;
auto l = itemsListView->Items;
std::list <unsigned int> v1;
for (int i=0; i < v->Size; i++)
{
unsigned int k;
l->IndexOf(v->GetAt(i),&k);
v1.push_back(k);
}