silverlight - How to create ListBox alternating row color

how to create ListBox alternating row color programmatically in silverlight
MainPage.xaml

<UserControl 
    x:Class="SilverlightApps.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    d:DesignHeight="600" 
    d:DesignWidth="800" 
    xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
    >

    <Grid x:Name="LayoutRoot" Background="White">
        <TextBlock 
            Height="82" 
            HorizontalAlignment="Left" 
            Margin="20,12,0,0" 
            Name="textBlock1" 
            Text="Silverlight - how to create ListBox alternating row color programmatically"
            VerticalAlignment="Top"
            TextWrapping="Wrap"
            FontSize="25"
            FontStyle="Italic"
            Foreground="MidnightBlue"
            Width="625"
            />

        <ListBox 
            Name="listBox1"
            HorizontalAlignment="Left" 
            Height="191" 
            Margin="82,108,0,0" 
            VerticalAlignment="Top" 
            Width="286"
            SelectionMode="Single"
            Loaded="listBox1_Loaded"
            FontSize="20"
            Foreground="Snow"
            FontFamily="Comic Sans MS"
            BorderThickness="0"
            FontStyle="Italic"
            >
            <ListBoxItem Content="Paraguay"></ListBoxItem>
            <ListBoxItem Content="South America"></ListBoxItem>
            <ListBoxItem Content="Pitcairn Island"></ListBoxItem>
            <ListBoxItem Content="Swaziland"></ListBoxItem>
            <ListBoxItem Content="United Kingdom"></ListBoxItem>
        </ListBox>

    </Grid>
</UserControl>
MainPage.xaml.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace SilverlightApps
{
    public partial class MainPage : UserControl
    {
        public MainPage()
        {
            InitializeComponent();
        }

        private void listBox1_Loaded(object sender, RoutedEventArgs e)
        {
            ItemCollection ic = listBox1.Items;

            int counter = 1;
            foreach (ListBoxItem lbi in ic)
            {
                if (counter % 2 == 1)
                {
                    lbi.Background = new SolidColorBrush(Color.FromArgb(255, 139, 0, 139));
                }
                else
                {
                    lbi.Background = new SolidColorBrush(Color.FromArgb(255, 153, 50, 204));
                }
                counter++;
            }
        }
    }
}