title: Programmatically change individual ListViewItem layout
body: <p>I have a <code>ListView</code> with a <code>GridView</code> in it:</p>
  
  <pre><code>&lt;ListView x:Name="listViewPersons" ItemsSource="{Binding Path=Persons, Mode=OneWay}" IsSynchronizedWithCurrentItem="True" 
                    Height="Auto" HorizontalAlignment="Stretch" Margin="4,4,4,4" Grid.Row="4" VerticalAlignment="Stretch" Width="Auto"&gt;
              &lt;ListView.View&gt;
                  &lt;GridView x:Name="gridViewPersons"&gt;
                      &lt;GridViewColumn Header="Enabled"&gt;
                          &lt;GridViewColumn.CellTemplate&gt;
                              &lt;DataTemplate&gt;
                                  &lt;StackPanel&gt;
                                      &lt;CheckBox HorizontalAlignment="Center" IsChecked="true" /&gt;
                                  &lt;/StackPanel&gt;
                              &lt;/DataTemplate&gt;
                          &lt;/GridViewColumn.CellTemplate&gt;
                      &lt;/GridViewColumn&gt;
                      &lt;GridViewColumn Header="Name"  DisplayMemberBinding="{Binding Path=Name}" Width="142" /&gt;
                      &lt;GridViewColumn Header="Age"  DisplayMemberBinding="{Binding Path=Age}" Width="142" /&gt;
                      &lt;GridViewColumn Header="Gender"  DisplayMemberBinding="{Binding Path=Gender}" Width="142" /&gt;
                  &lt;/GridView&gt;
              &lt;/ListView.View&gt;
          &lt;/ListView&gt;
  </code></pre>
  
  <p>I want to be able to programmatically change each of the <code>ListViewItem</code>s (or the rows in the grid) backgrounds or foregrounds to any color I want, for instance</p>
  
  <pre><code>listViewPersons.Items[0].Background = Brush.Red;
  listViewPersons.Items[1].Background = Brush.Blue;
  listViewPersons.Items[2].Background = Brush.Green
  </code></pre>
  
  <p>I know the previous lines of code don't work, but it pretty much explains what I want to achieve. Any help?</p>
  
  <p>Thanks!</p>