title: Add context menu on right click.
body: <pre><code>public void mytree()
  {
      DatabaseCore db = new DatabaseCore();
  
      List&lt;allTreeView&gt; myList = new List&lt;allTreeView&gt;();
  
      DataTable dt = db.FillDataGrid();
      foreach (DataRow row in dt.Rows)
      {
          string categories_id1 = row["ID"].ToString();
          string parent_id = row["parentId"].ToString();
          string categories_name = row["name"].ToString();
          myList.Add(new allTreeView(
                      int.Parse(categories_id1), 
                      categories_name, 
                      int.Parse(parent_id)));
      }
      Dictionary&lt;int, TreeViewItem&gt; flattenedTree = 
          new Dictionary&lt;int, TreeViewItem&gt;();
  
      foreach (allTreeView item in myList)
      {
  
          TreeViewItem treeNode = new TreeViewItem();
          treeNode.Header = item.Header;              //this is header
          treeNode.Tag = item;
          flattenedTree.Add(item.ID, treeNode);
          if (flattenedTree.ContainsKey(item.ParentID))
          {
              flattenedTree[item.ParentID].Items.Add(treeNode);
          }
          else
          {
              product_tree.Items.Add(treeNode);
          }
      }
  }
  </code></pre>
  
  <p>This populates my tree. 
  I want to show context menu on right click for copy, cut, select and add some more functionality on each node of my tree.</p>