title: Displaying Entities in TreeView using MVVM
body: <p>I am making a WPF application following MVVM pattern. In this i am using entity framework,</p>
  
  <p>my entity structure is simple, it has 3 entities: department, course, books,</p>
  
  <p>a department can have many courses, and a course can have many books,</p>
  
  <p>now i want to show this in a treeview, so my output in wpf should look like this,</p>
  
  <pre><code>Department1
  
    Course1
  
      Book1
  
      Book2
  
    Course2
  
      Book3
  
  Department2
  
    Course
  
       Book
  
  Department3   
  </code></pre>
  
  <p>in my ViewModel i have EntityContext object. But i dont know how to show this in a treeview.
  how i can do this. </p>