title: Fill wpf treeview with mvvm
body: <p>I have a table named customer with fileds(ID,Name,Code,FatherID).
   Field (ID) and (FatherID) are connected together.</p>
  
  <p>i get a list of customer in mvvm (AllCustomer )</p>
  
  <pre><code>      public  ViewModelList(CRMEntities crm)
      {
          var all = from h in crm.Customer
                    select h;
          AllCustomer = new ObservableCollection&lt;Customer&gt;(all.ToList());
      }
  
      public ObservableCollection&lt;Customer&gt; AllCustomer
      {
          get;
          set;
      }
  </code></pre>
  
  <p>/* xml file</p>
  
  <pre><code>        &lt;TreeView Name="folderTree"
       ItemsSource="{Binding AllCustomer}"&gt;
  
          &lt;TreeView.ItemTemplate&gt;
              &lt;HierarchicalDataTemplate ItemsSource="{Binding AllCustomer}"
                               DataType="{x:Type cls:Customer}"&gt;
  
                  &lt;StackPanel Orientation="Horizontal"&gt;
                      &lt;TextBlock Text="{Binding Name}" /&gt;
                  &lt;/StackPanel&gt;
  
              &lt;/HierarchicalDataTemplate&gt;
          &lt;/TreeView.ItemTemplate&gt;
  
      &lt;/TreeView&gt;
  </code></pre>
  
  <p>i want  fill  treeview that display all of customer as the father of son  !</p>
  
  <p><strong>Who i can fill treeview with customers , with mvvm ?</strong>
  <img src="https://i.stack.imgur.com/eWj72.png" alt="My customer Model"></p>