/// <summary>
 /// Event handler for the context menu for stripe header
 /// </summary>
 /// <remarks>We show only a simple context menu that demonstrates the <see cref="TableEditorInputMode.InsertChild"/> convenience method.</remarks>
 private void graphEditorInputMode_PopulateItemContextMenu(object sender,
                                                           PopulateItemContextMenuEventArgs <IModelItem> e)
 {
     if (!e.Handled)
     {
         StripeSubregion stripe = GetStripe(e.QueryLocation);
         if (stripe != null)
         {
             var deleteItem = new MenuItem {
                 Header = "Delete " + stripe.Stripe, Command = ApplicationCommands.Delete, CommandParameter = stripe.Stripe
             };
             e.Menu.Items.Add(deleteItem);
             var insertBeforeItem = new MenuItem {
                 Header = "Insert new stripe before " + stripe.Stripe
             };
             insertBeforeItem.Click += delegate {
                 IStripe parent = stripe.Stripe.GetParentStripe();
                 int     index  = stripe.Stripe.GetIndex();
                 tableEditorInputMode.InsertChild(parent, index);
             };
             e.Menu.Items.Add(insertBeforeItem);
             var insertAfterItem = new MenuItem {
                 Header = "Insert new stripe after " + stripe.Stripe
             };
             insertAfterItem.Click += delegate {
                 IStripe parent = stripe.Stripe.GetParentStripe();
                 int     index  = stripe.Stripe.GetIndex();
                 tableEditorInputMode.InsertChild(parent, index + 1);
             };
             e.Menu.Items.Add(insertAfterItem);
             e.Handled = true;
         }
     }
 }
 /// <summary>
 /// Event handler for tool tips over a stripe header
 /// </summary>
 /// <remarks>We show only tool tips for stripe headers in this demo.</remarks>
 private void MouseHoverInputMode_QueryToolTip(object sender, ToolTipQueryEventArgs e)
 {
     if (!e.Handled)
     {
         StripeSubregion stripe = GetStripe(e.QueryLocation);
         if (stripe != null)
         {
             e.ToolTip = stripe.Stripe.ToString();
             e.Handled = true;
         }
     }
 }