title: Changing Grid Row background color in WPF
body: <p>I want to set 2 colors to my grid rows, the even ones will have one color and the others will have another.
  I dont know ho to even start of doing it.</p>
  
  <pre><code>&lt;ListBox
      ItemsSource="{Binding}" x:Name="station_list"
      HorizontalAlignment="Left" Height="378" Margin="10,31,0,0"
      VerticalAlignment="Top" Width="570" SelectedIndex="0"&gt;
      &lt;ListBox.ItemTemplate&gt;
          &lt;DataTemplate&gt;
              &lt;Grid x:Name="Stations_Template"&gt;
                  &lt;Grid.RowDefinitions&gt;
                      &lt;RowDefinition Height="Auto" /&gt;
                  &lt;/Grid.RowDefinitions&gt;
                  &lt;Grid.ColumnDefinitions&gt;
                      &lt;ColumnDefinition Width="*" /&gt;
                      &lt;ColumnDefinition Width="*" /&gt;
                      &lt;ColumnDefinition Width="*" /&gt;
                      &lt;ColumnDefinition Width="*" /&gt;
                      &lt;ColumnDefinition Width="*" /&gt;
                  &lt;/Grid.ColumnDefinitions&gt;
  
                  &lt;TextBlock Grid.Column="0" Text="First Name: " /&gt;
                  &lt;TextBlock Grid.Column="1" Text="{Binding Path=sname}" /&gt;
                  &lt;TextBlock Grid.Column="2" Text="Last Name: " /&gt;
                  &lt;TextBlock Grid.Column="3" Text="{Binding Path=mahoz}" /&gt;
                  &lt;CheckBox Grid.Column="4" Content="Is Active?"
                      IsEnabled="False"
                      IsChecked="{Binding Path=isactive}" /&gt;
              &lt;/Grid&gt;
          &lt;/DataTemplate&gt;
      &lt;/ListBox.ItemTemplate&gt;
  &lt;/ListBox&gt;
  </code></pre>