title: unable to cast from object to Treeviewitem
body: <p>I'm trying to Cast from an object to a TreeviewItem and getting the next error:</p>
  
  <pre><code>"unable to cast object of type 'system.string' to type 'system.windows.controls.treeviewitem'."
  </code></pre>
  
  <p>For 2 days I'm searching for a solution to this, I saw many examples of explicit cast to treeviewitem so I think it legit but its not working.</p>
  
  <pre><code>foreach (Req ObjReq in reqFilter.NewList())
   {
      index = PM_TreeView.Items.Add(ObjReq.Name);
      TreeViewItem ParentNode = new TreeViewItem();
  
      //this is the Cast I try to do 
      ParentNode = (TreeViewItem)PM_TreeView.Items[index];
  
      ParentNode.Tag = ObjReq.ID;
      reqFilter["RQ_FATHER_ID"] = (ObjReq.ID.ToString());
      reqFilter.KeepHierarchical = true;
      if (reqFilter.NewList().Count &gt; 0)
          FillReqTreeView(reqFilter, ObjReq);
    }
  </code></pre>
  
  <p>The main idea is to populate the List in the reqFilter to a Treeview.</p>