title: how to right click on item from Listbox and open menu on WPF
body: <p>i have Listbox with files in, i want to able to right click and open a menu like Delete in order to remove files from the Listbox.</p>
  
  <p>currently i have this function after right click on item inside my Listbox</p>
  
  <pre><code>private void listBoxFiles_PreviewMouseRightButtonDown(object sender, MouseButtonEventArgs e)
  {
  
  }
  </code></pre>
  
  <p>and i implement at XAML Delete menu after right click</p>
  
  <pre><code>          &lt;ListBox.ContextMenu&gt;
                  &lt;ContextMenu&gt;                                                        
                      &lt;MenuItem Header="Delete"/&gt;
                  &lt;/ContextMenu&gt;
              &lt;/ListBox.ContextMenu&gt;
  </code></pre>
  
  <p>the function who delete file from my ListBox:</p>
  
  <pre><code>private void MenuItemDelete_Click(object sender, RoutedEventArgs e)
  {            
      if (listBoxFiles.SelectedIndex == -1)
      {
          return;
      }
  
      //string filePath = (listBoxFiles.SelectedItem).ToString();
      int index = listBoxFiles.SelectedIndex;
      listBoxFiles.Items.RemoveAt(index);
  }
  </code></pre>