title: Why does not the ContextMenu(popup menu) show up?
body: <p>The following class derives from <code>System.Windows.Controls.UserControl</code>. In said class I call <code>OpenFileDialog</code> to open a XAML file (workflow file). Next, I implement a dynamic menu when right clicking the mouse.   The menu does not show up.  Is this a threading problem or a UI problem? In my research I've been unable to discover a solution.</p>
  
  <p>Thanks in advance.</p>
  
  <pre><code>private void File_Open_Click(object sender, RoutedEventArgs e)
  {
      var fileDialog = new OpenFileDialog();
  
      fileDialog.Title  = "Open Workflow";
      fileDialog.Filter = "Workflow| *.xaml";
  
      if (fileDialog.ShowDialog() == DialogResult.OK)
      {
          LoadWorkflow(fileDialog.FileName);
          MouseDown += new System.Windows.Input.MouseButtonEventHandler(mouseClickedResponse);
       }
  }
  
  private void mouseClickedResponse(object sender, System.Windows.Input.MouseEventArgs e)
  {
      if (e.RightButton == MouseButtonState.Pressed)
      {
           LoadMenuItems();
      }
  }
  
  private void LoadMenuItems()
  {
      System.Windows.Controls.ContextMenu contextmenu = new System.Windows.Controls.ContextMenu();   
      System.Windows.Controls.MenuItem item1 = new System.Windows.Controls.MenuItem();
      item1.Header = "A new Test";
      contextmenu.Items.Add(item1);
      this.ContextMenu = contextmenu;
      this.ContextMenu.Visibility = Visibility.Visible;
  }
  </code></pre>