title: How do I obtain the Index of a ListViewItem?
body: <p>I have a list view that uses a collectionsource and wish to set the background colour of the ListViewItems depending upon whether their index in the list matches a value held in the view model. To do this I am binding the background of the listVeiwItem to the value in the ViewModel, and using a converter to determine the background colour.  To make this determination the converter needs to be passed the ListViewItem's index. How do I obtain the index using XAML?</p>
  
  <p>Here is the XAML for the data template used by the ListView:</p>
  
  <pre><code>&lt;DataTemplate x:Key="ILMemberTemplate"&gt;
      &lt;StackPanel Orientation="Horizontal" Background="{Binding Path=ListIndex, Mode=OneWay, Converter={StaticResource ParticipantBackground}, ConverterParameter={???}}"&gt;
          &lt;TextBlock
              Width="200"
              TextAlignment="Left"
              Foreground="{Binding Path=IsPC, Mode=OneWay, Converter={StaticResource ParticipantColour}}"
              Text="{Binding Path=Name, Mode=OneWay}"/&gt;
          &lt;TextBlock
              Width="40"
              TextAlignment="Center"
              Foreground="{Binding Path=IsPC, Mode=OneWay, Converter={StaticResource ParticipantColour}}"
              Text="{Binding Path=Initiative, Mode=OneWay}"/&gt;
      &lt;/StackPanel&gt;
  &lt;/DataTemplate&gt;
  </code></pre>