title: How to add different background colors to alternate rows to list box items windows phone 8
body: <p>I'm new to windows phone development.</p>
  
  <p>I'm showing data in list box. For for all rows in the list box the back ground color is same.
  But I want to add two different colors for alternate rows to list box items.</p>
  
  <p>Below is the code for list view.</p>
  
  <pre><code>    &lt;Grid x:Name="ContentPanel" Grid.Row="1" Margin="0,10,0,0" Background="White"&gt;
          &lt;ListBox Margin="6,6,-6,6" Name="itemslb" SelectionChanged="itemList_SelectionChanged"&gt;
              &lt;ListBox.ItemTemplate&gt;
                  &lt;DataTemplate&gt;
                      &lt;Grid x:Name="listItem"&gt;
                          &lt;Grid.RowDefinitions&gt;
                              &lt;RowDefinition Height="100"/&gt;
                              &lt;RowDefinition Height="10"/&gt;
                          &lt;/Grid.RowDefinitions&gt;
  
                          &lt;StackPanel Grid.Row="0" Orientation="Horizontal" Height="100" Margin="0,10,0,0"&gt;
                                &lt;StackPanel Width="85" Height="100" &gt;
                                      &lt;StackPanel.Background&gt;
                                          &lt;ImageBrush x:Name="defImage" ImageSource="/DailyFeeds;component/Images/default.png" Stretch="None"&gt;&lt;/ImageBrush&gt;
                                      &lt;/StackPanel.Background&gt;
                                          &lt;Image  Source="{Binding ImageUrl}" VerticalAlignment="Top" Height="90" Width="85" Margin="0,0,10,0" Stretch="Fill" /&gt;
                                &lt;/StackPanel&gt;
                                &lt;StackPanel Width="370"&gt;
                                      &lt;TextBlock Text="{Binding Title}" Foreground="SlateBlue" FontSize="25" TextWrapping="Wrap" /&gt;
                                      &lt;TextBlock Text="{Binding Date}" Foreground="#FFC8AB14" FontSize="20"/&gt;                               
                                &lt;/StackPanel&gt;                                
                          &lt;/StackPanel&gt;
  
                             &lt;Image  x:Name="line" Grid.Row="1" Width="460" HorizontalAlignment="Center" Margin="0,5,0,0" Source="/DailyFeeds;component/Images/separator.png" /&gt;
                      &lt;/Grid&gt;
  
                  &lt;/DataTemplate&gt;
              &lt;/ListBox.ItemTemplate&gt;
          &lt;/ListBox&gt;
      &lt;/Grid&gt;
  </code></pre>
  
  <p>How can we do that.</p>
  
  <p>Thanks</p>