title: XamlParseException was Unhandled when adding MenuItems
body: <p>During implementing the answer from <a href="https://stackoverflow.com/questions/18080363/is-it-possible-to-add-menu-items-to-a-context-menu-during-implementation?answertab=oldest#tab-top">this question</a> I came across the <code>XamlParseException</code> run-time error.</p>
  
  <p>I will explain when the error occurs, because it doesn't make any sense to me. First of all, I use the solution from the previous question to build two <code>Context Menus</code> that come down when the user right-clicks the <code>TreeViewitems</code>.</p>
  
  <p><strong>EDIT:</strong> For better understanding, I'm going to post the code exactly how I have it. I am still receiving the error after switching my code to this.</p>
  
  <pre><code>public static TreeViewItem item1 = new TreeViewItem();
  public static TreeViewItem item2 = new TreeViewItem();
  
  ContextMenu item1_CM = new ContextMenu() { Background = Brushes.White, BorderBrush = Brushes.Black, BorderThickness = new Thickness(1) };
          MenuItem add1 = new MenuItem() { Header = "Add..." }; //Add &amp; Delete MenuItems
          MenuItem delete1 = new MenuItem() { Header = "Delete..." };
  
  ContextMenu item2_CM = new ContextMenu() { Background = Brushes.White, BorderBrush = Brushes.Black, BorderThickness = new Thickness(1) };
          MenuItem add2 = new MenuItem() { Header = "Add..." }; //Add &amp; Delete MenuItems
          MenuItem delete2 = new MenuItem() { Header = "Delete..." };
  
  public constructor()
  {
       Tree = new ObservableCollection&lt;TreeViewItem&gt;();
       Tree.Add(item1);
       Tree.Add(item2);
  
       //Add MenuItems to TreeView ContextMenus
       item1_CM.Items.Add(add1);
       item1_CM.Items.Add(delete1);
       item1.Items.Add(item1_CM);
  
       item2_CM.Items.Add(add2);
       item2_CM.Items.Add(delete2);
       item2.Items.Add(item2_CM);
  }
  </code></pre>
  
  <p>I add two <code>MenuItems</code> EXACTLY like this for two <code>TreeViewItems</code>. If I compile and run with the first set implemented, the program runs fine, but after adding new <code>MenuItems</code> to the other <code>TreeViewItem</code>, I get that <code>XamlParseException was unhandled</code> error. What could be causing this?</p>
  
  <p>Thanks for your help.</p>
  
  <p><strong>XAML As requested</strong></p>
  
  <pre><code>&lt;Window x:Class="CircularButtonPrototype.Window1"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:sys="clr-namespace:System;assembly=mscorlib"
      xmlns:cmp="clr-namespace:System.ComponentModel;assembly=WindowsBase"
      Title="Window1" MinHeight="685" MaxHeight="685" Height="685" MinWidth="1044" MaxWidth="1044" Width="1044" AllowsTransparency="False" WindowStartupLocation="CenterScreen" WindowStyle="None" Visibility="Visible"&gt;
  &lt;/Window&gt;
  </code></pre>
  
  <p>My <code>TreeView</code> in <code>XAML</code>:</p>
  
  <pre><code>&lt;TreeView Name="Tree_One" ItemsSource="{Binding Tree}" HorizontalAlignment="Left" Background="White" SelectedItemChanged="Tree_One_SelectedItemChanged" /&gt;
  </code></pre>