title: Sub-menu for each binding item
body: <p>Following the <a href="http://weblogs.asp.net/okloeten/5149692" rel="nofollow">example</a> from Omer van Kloeten I filled a menu with menu items bound from my observable collection. I got a single menu item for a single collection item. Fine, but I actually want more. I also want to be able to have a menu item with two or three sub items for one collection item. Here is some rough sketch:</p>
  
  <pre><code>What I Have         What I Want
  + First Item        + Create First Item
  + Second Item       + Second Item
                        + Delete
                        + Update
  </code></pre>
  
  <p>Here "First Item" has property <code>Exists = false</code>, but "Second Item" has it <code>true</code>. My current code:</p>
  
  <pre><code>public class CollectionItem
  {
      public string Name { get; set; }
      public bool Exists { get; set; }
  }
  
  public partial class MainWindow : Window
  {
      ObservableCollection&lt;CollectionItem&gt; items;
  
      public MainWindow()
      {
          items = new ObservableCollection&lt;CollectionItem&gt;();
          items.Add(new CollectionItem() { Name = "First Item", Exists = false });
          items.Add(new CollectionItem() { Name = "Second Item", Exists = true });
          AllItems.ItemsSource = items;
      }
  }
  
  &lt;MenuItem x:Name="AllItems" Header="What I Have"&gt;
      &lt;MenuItem.ItemContainerStyle&gt;
          &lt;Style TargetType="{x:Type MenuItem}"&gt;
              &lt;Setter Property="Header" Value="{Binding Path=Name}" /&gt;
          &lt;/Style&gt;
      &lt;/MenuItem.ItemContainerStyle&gt;
  &lt;/MenuItem&gt;
  </code></pre>
  
  <p>How do I mix simple menu items with sub items?</p>