title: How to hide TreeView root?
body: <p>I am working on WPF <code>TreeView</code>, and I want to hide the parent of the tree. For this case the parent is:</p>
  
  <pre><code>var parent = new TreeViewModel() { Value = "Main Root" };  
  </code></pre>
  
  <p>I populated my tree structure using this method:</p>
  
  <pre><code>public ObservableCollection&lt;MessageElementViewModel&gt; GetAllTreeNodes()
  {
      List&lt;TreeViewModel&gt; reqNodes = GetRequestTreeNodesFromModel();  // req
      //List&lt;TreeViewModel&gt; respNodes = GetRequestTreeNodesFromModel();  // res
  
      var request = new TreeViewModel();
      var response = new TreeViewModel();
      var parent = new TreeViewModel() { Value = "Main Root" };
  
      for (int i = 0; i &lt; wsMethodNameList.Count; i++)
      {
          var child = new TreeViewModel { Value = wsMethodNameList[i] };
          parent.Children.Add(child);
          var requestChild = new TreeViewModel { Value = requestXmlList[i] };
  
          requestChild.Children = reqNodes;
          child.Children.Add(requestChild);
  
          var responseChild = new TreeViewModel { Value = responseXmlList[i] };
          responseChild.Children = reqNodes; // change to response nodes
          child.Children.Add(responseChild);
      }
      return new ObservableCollection&lt;TreeViewModel&gt; { parent};
  </code></pre>
  
  <p>xaml</p>
  
  <pre><code>&lt;TreeView Margin="644,137,6,6" Grid.RowSpan="2" ItemsSource="{Binding Path=MessageElements,  Mode=TwoWay}"&gt;
      &lt;TreeView.Resources&gt;
          &lt;HierarchicalDataTemplate DataType="{x:Type local:MessageElementViewModel}" ItemsSource="{Binding Path= Children }"&gt;
                  &lt;CheckBox IsChecked="{Binding Name}" Content="{Binding Name}" /&gt;
          &lt;/HierarchicalDataTemplate&gt;
      &lt;/TreeView.Resources&gt;
  &lt;/TreeView&gt;
  </code></pre>
  
  <p>ViewModel</p>
  
  <pre><code>public ObservableCollection&lt;MessageElementViewModel&gt; MessageElements
  {
      get { return messageElement; }
      set
      {
          if (messageElement == value)
              return;
          messageElement = value;
          NotifyPropertyChanged("MessageElements");
      }
  }
  </code></pre>
  
  <p>Loading data</p>
  
  <pre><code>public void LoadData()
  {
      this.MessageElements = treeVModel.GetAllTreeNodes();
  }
  </code></pre>
  
  <p>On my xaml  I want to hide <code>parent = new TreeViewModel() { Value = "Main Root" };</code>. </p>
  
  <p>How can I achieve that? I tried to give it an empty string but it still shows the expand icon.</p>