title: How can I bind ListView to view specific properties of a set of objects?
body: <p>For those who'd want to know, this is in the context of a tool for self-stabilizing algorithms.</p>
  
  <p>Say I have a few classes, <code>Algorithm</code>, <code>Rule</code>, <code>Predicate</code>, <code>Action</code>, <code>Graph</code>, and <code>Node</code>, defined thus:</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Text;
  
  namespace SMP {
      class Algorithm {
          public List&lt;Rule&gt; Rules { get; set; }
  
          public Algorithm() {
              Rules = new List&lt;Rule&gt;();
          }
      }
  
      class Rule {
          public Predicate Predicate { get; set; }
          public Action Action { get; set; }
      }
  
      class Predicate {
          public string Description { get; set; }
          public string Name { get; set; }
          public string Expression { get; set; }
      }
  
      class Action {
          public string Description { get; set; }
          public string Name { get; set; }
          public string Expression { get; set; }
      }
  }
  </code></pre>
  
  <p>I would like to connect a two-column <code>ListView</code> that will display <code>Predicate.Name</code> and <code>Action.Name</code> for each element in some <code>Algorithm.Rules</code>.</p>
  
  <p>Note the following variable names I'm using for this post:</p>
  
  <pre><code>ListView algorithm_view;
  Algorithm algorithm
  </code></pre>
  
  <p>I do know that I must set the <code>DataContext</code> of <code>algorithm_view</code> to my <code>Algorithm</code> instance with <code>algorithm_view.DataContext = algorithm</code>, but I don't know how to express a binding of a collection like this in XAML.</p>
  
  <p>If it helps to picture it, here is a screenshot of the interface:</p>
  
  <p><img src="https://i.stack.imgur.com/t2X4k.png" alt="enter image description here"></p>