I have a ListView whose ItemsSource is set to a collection property of my ViewModel. There is also a property on the ViewModel, say 'CurrentIndex', that changes as the code runs. As this changes I want ONLY the ListViewItem whose index in the ListView that matches 'CurrentIndex' to change, say its Background to change colour. As 'CurrentIndex' changes I want the previously referenced ListViewItem to be 'reset', i.e. its Background changes to it prior colour. Does anyone know how might I achieve this?
I thought of exploiting the SelectedIndex Property of the ListView but this doesn't work as the user can click on the ListView and change the selection thereby changing the background of the wrong item.
The ListViewItems are Templated via ItemTemplate in XAML.
Hope this makes sense.
Many thanks in advance for any help.