title: How to setup a WPF datatemplate in code for a treeview?
body: <pre><code>struct Drink
  {
      public string Name { get; private set; }
      public int Popularity { get; private set; }
  
      public Drink ( string name, int popularity )
          : this ( )
      {
          this.Name = name;
          this.Popularity = popularity;
      }
  }
  
  List&lt;Drink&gt; coldDrinks = new List&lt;Drink&gt; ( ){
      new Drink ( "Water", 1 ),
      new Drink ( "Fanta", 2 ),
      new Drink ( "Sprite", 3 ),
      new Drink ( "Coke", 4 ),
      new Drink ( "Milk", 5 ) };
          }
      }
  </code></pre>
  
  <p>So that I can see the Name property for treeview item names.</p>