title: how to bind an object to treeview?
body: <p>I'm trying to bind an object (that fetched from db) to treeview control.</p>
  
  <p>My object stracture is somethings like this :</p>
  
  <pre><code>public class Post
  {
      [DataMember]
      public string Name { set; get; }
  
      [DataMember]
      public List&lt;Post&gt; SubPosts { get; set; }
  }
  </code></pre>
  
  <p>I defined a method that get data from db and put that in a property of my class:</p>
  
  <p>My Property :</p>
  
  <pre><code>private Post _posts;
  public Post Posts
  {
      set
      {
          _posts = value;
          InvokePropertyChanged("Posts");
      }
      get { return _posts; }
  }
  </code></pre>
  
  <p>then</p>
  
  <pre><code>Posts = _orgChartModel.GetOrgChartByParentId(1);
  </code></pre>
  
  <p>Now,I want to bind the "Posts" property to a treeview.</p>
  
  <p>XAML code :</p>
  
  <pre><code>&lt;sdk:TreeView ItemsSource="{Binding Posts}"&gt;
  &lt;sdk:TreeView.ItemTemplate&gt;
      &lt;sdk:HierarchicalDataTemplate ItemsSource="{Binding Path=SubPosts}" &gt;
          &lt;StackPanel &gt;
              &lt;Image Width="48" Height="48" 
                  Source="/CalendarClass;component/Assets/person.png" /&gt;
              &lt;TextBlock TextAlignment="Center" VerticalAlignment="Center" 
                  Text="{Binding Path=Name}" /&gt;
          &lt;/StackPanel&gt;
      &lt;/sdk:HierarchicalDataTemplate&gt;
  &lt;/sdk:TreeView.ItemTemplate&gt;
  </code></pre>
  
  <p></p>
  
  <p>My code does not work,What's wrong?</p>