title: how to change text based on condition in listview xamarin forms
body: <p>I am new to xamarin forms and c#. I am using WCF web service. I am getting an List and want to check a condition and based on that condition i want to update the listview.
  i have searched article, but founded nothing that i wanted.
  till now i have done this.</p>
  
  <pre><code>IEnumerable&lt;LoadTrackedEmployee&gt; _trackedEmployee; 
  
      private void Client_LoadTrackingEmployeeCompleted(object sender, LoadTrackingEmployeeCompletedEventArgs e)
              {
                  var response = e.Result.ToString();
                  var result = JsonConvert.DeserializeObject&lt;List&lt;LoadTrackedEmployee&gt;&gt;(response);
  
                  Device.BeginInvokeOnMainThread(() =&gt;
                  {
  
                      _trackedEmployee = result as IEnumerable&lt;LoadTrackedEmployee&gt;;
                      employeeList.ItemsSource = _trackedEmployee;
                      foreach(var item in _trackedEmployee)
                      {
                          if(item.int_LastLogin==null)
                          {
  
                              // I am trying to change it here. I have given label x:name="status" and i am trying to do this
                             status.TextColor = "Red"; // for some reason this doesnt work
                          }else{ status.TextColor = "Green"; }
                      }
                  });
              }  
  </code></pre>
  
  <p>IValueConverter example</p>
  
  <p>LoadTrackedEmployee.cs</p>
  
  <pre><code>public class LoadTrackedEmployee
      {
  
          public string vchar_UserGUID { get; set; }
          [JsonProperty(PropertyName = "User ID")]
          public string UserID { get; set; }
          [JsonProperty(PropertyName = "Full Name")]
          public string FullName { get; set; }
          [JsonProperty(PropertyName = "Official Email ID")]
          public string OfficialEmailID { get; set; }
          public int? int_LastLogin { get; set; }
  
      }
  </code></pre>
  
  <p>ListToColorConerter.cs</p>
  
  <pre><code>    public class ListToColorConverter : IValueConverter
          {
              #region IValueConverter implementation
  
              public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
              {
                  throw new NotImplementedException();
  //What should i do here
              }
  
              public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
              {
                  throw new NotImplementedException();
              }
  
              #endregion
          }
  </code></pre>
  
  <p>XAML</p>
  
  <pre><code>    &lt;ContentPage.Resources&gt;
          &lt;ResourceDictionary&gt;
              &lt;local:StringToColorConverter x:Key="ListConverter" /&gt;
          &lt;/ResourceDictionary&gt;
      &lt;/ContentPage.Resources&gt;
  
      &lt;ListView x:Name="employeeList" 
                        HasUnevenRows="True"
                        SeparatorVisibility="Default"  
                        ItemSelected="employeeList_ItemSelected"
                        SeparatorColor="Black"
                        Margin="5,0,5,0"&gt;
                  &lt;ListView.ItemTemplate&gt;
                      &lt;DataTemplate&gt;
                          &lt;ViewCell&gt;
                              &lt;StackLayout Orientation="Horizontal"&gt;
                                  &lt;Label x:Name="status" BackgroundColor="{Binding ., Converter={StaticResource ListToColorConverter }}}" WidthRequest="3" HorizontalOptions="Start" Margin="0,2,0,2"/&gt;
                              &lt;/StackLayout&gt;
                          &lt;/ViewCell&gt;
                      &lt;/DataTemplate&gt;
                  &lt;/ListView.ItemTemplate&gt;        
      &lt;/ListView&gt;
  </code></pre>
  
  <p>and i have also added local xmlns</p>