title: How to conditionally bind TextCell Detail attribute?
body: <p>In a xamarin.forms android project I am working on, I have a list of objects that I want to display in a ListView. The objects are based on ClassA:</p>
  
  <pre><code>public class ClassA
  {
      public Guid Id { get; set; }
      public string Name { get; set; }
      public List&lt;ClassB&gt; Types { get; set; }
  }
  </code></pre>
  
  <p>Note the List of ClassB objects. ClassB looks like this:</p>
  
  <pre><code>public class ClassB
  {
      public string Type { get; set; }
      public int Count { get; set; }
  }
  </code></pre>
  
  <p>I have this partially working using XAML, like this:</p>
  
  <pre><code>&lt;TextCell Text="{Binding Name}" Detail="{Binding Types[0].Count }" Tapped="Cell_OnTapped" /&gt;
  </code></pre>
  
  <p>The issue is that the binding for the Detail attribute needs to change for each row depending on the value of the ClassA.ClassB.Type property. E.g. if <code>Types[0].Count &gt; 0</code> then the TextCell binding for the Detail attribute should be:</p>
  
  <pre><code>Types[0].Count
  </code></pre>
  
  <p>If <code>Types[0].Count &gt; 0</code> AND <code>Types[1].Count &gt; 0</code> then the TextCell binding for the Detail attribute should be:</p>
  
  <pre><code>"type 1 count: " + Types[0].Count + "type 2: count: " Types[1].Count
  </code></pre>
  
  <p>Note that there are never more than three items in ClassA.Types. Also, ClassB.Count values are all precalculated.</p>
  
  <p>What would be the best way to go about this using xamarin.forms for Android?</p>