title: Change ListView Item Background Color based on the value of the Item C# Xamarin.Forms
body: <p>I tried looking up the similar problem on the Internet but nothing seems to be like mine.</p>
  
  <p>I have a ListView that displays list of records:</p>
  
  <pre><code>    &lt;ListView x:Name="TavoloListView" HasUnevenRows="true" Grid.Row="2" SeparatorColor="Black"  
       SelectedItem="{Binding SelectedTavoloItem, Mode=TwoWay}" &gt;
          &lt;ListView.ItemTemplate&gt;
              &lt;DataTemplate&gt;
                  &lt;ViewCell&gt;
                      &lt;Grid  ColumnSpacing="0" RowSpacing="0"&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;ColumnDefinition Width="*"/&gt;
                          &lt;/Grid.ColumnDefinitions&gt;
                          &lt;BoxView x:Name="ItemsBackground" Grid.Column="0" Grid.ColumnSpan="6" Color="White" Opacity="0.5"/&gt;
                          &lt;Label Text="{Binding TavoloNo}" Grid.Row="0" Grid.Column="0" TextColor="Black" HorizontalOptions="Center"/&gt;
                          &lt;Label Text="{Binding CameraNo}" Grid.Row="0" Grid.Column="1" TextColor="Black" HorizontalOptions="Center"/&gt;
                          &lt;Label Text="{Binding Arrivo, StringFormat='\{0:dd/MM/yy}'}" Grid.Row="0" Grid.Column="2" TextColor="Black" HorizontalOptions="Center"/&gt;
                          &lt;Label Text="{Binding Partenza, StringFormat='\{0:dd/MM/yy}'}" Grid.Row="0" Grid.Column="3" TextColor="Black" HorizontalOptions="Center"/&gt;
                          &lt;Label Text="{Binding PersoneTot}" Grid.Row="0" Grid.Column="4" TextColor="Black" HorizontalOptions="Center"/&gt;
                          &lt;Label Text="{Binding Bambini, StringFormat='(\{0}\)'}" Grid.Row="0" Grid.Column="5" TextColor="Black" HorizontalOptions="Center"/&gt;
                      &lt;/Grid&gt;
                  &lt;/ViewCell&gt;
              &lt;/DataTemplate&gt;
          &lt;/ListView.ItemTemplate&gt;
      &lt;/ListView&gt;
  </code></pre>
  
  <p>I need to change <code>ItemsBackground</code> <code>BoxView</code>'s Color based on the result of comparison of two <code>Label</code>s <code>Arrivo</code> and <code>Partenza</code>.
  Basically, on the page there is <code>DatePicker</code> named <code>MainDatePicker</code>.
  I want to compare the records' <code>Arrivo</code> and <code>Partenza</code> Date Values with the <code>MainDatePicker.Date</code>. If <code>Arrivo == MainDatePicker.Date</code> I want to change the <code>ItemsBackground</code> <code>BoxView</code>'s Color to Green. If <code>Partenza</code> matches the <code>MainDatePicker.Date</code> the <code>ItemsBackground</code> <code>BoxView</code>'s Color should be Red.</p>
  
  <p>If none of the above is true, the color remains white.</p>
  
  <p>Is it possible to achieve this?</p>