title: Adding an extra level in wpf mvvm data bound menu item
body: <p>I've a menu item named 'Authors' whose <code>ItemsSource</code> is bound to an <code>ObservableCollection</code> called <code>CollectionOfAuthors</code>. Clicking on <em>Authors</em> opens a list of author names. What modifications I need to do to add an extra level of menu item, In simple words,  I wish to display list of books for each author-name.</p>
  
  <p>Like this:</p>
  
  <pre><code>Author
   |__AuthorName 1
      |__Book 1
      |__Book 2
  </code></pre>
  
  <p>Here's my existing code:</p>
  
  <p>MainWindow.xaml</p>
  
  <pre><code>&lt;MenuItem Header="Authors" ItemsSource="{Binding CollectionOfAuthors}"&gt;
      &lt;MenuItem.ItemTemplate&gt;
          &lt;DataTemplate&gt;
              &lt;TextBlock Text="{Binding AuthorName}" /&gt;                                    
          &lt;/DataTemplate&gt;
      &lt;/MenuItem.ItemTemplate&gt;
  &lt;/MenuItem&gt;
  </code></pre>
  
  <p>MainWindowViewModel.cs</p>
  
  <pre><code>private ObservableCollection&lt;Author&gt; _collectionOfAuthors;
  
  public ObservableCollection&lt;Author&gt; CollectionOfAuthors
  {
      get { return _collectionOfAuthors; }
      set { SetProperty(ref _collectionOfAuthors, value); }
  }
  
  public class Author
  {
     public string AuthorName {get; set;}
  
     private ObservableCollection&lt;BookDetails&gt; _Books;
  
     public ObservableCollection&lt;BookDetails&gt; Books
     {
         get { return _Books; }
         set { SetProperty(ref _Books, value); }
      }
  }
  </code></pre>