title: Adding an click event to a programatically added menu item
body: <p>I am working on a C# WPF project and I am storing some items in an SQLite database, when the program loads, it then retrieves the items from the database and adds the items to the menu. What I then need to do is to allow the user to click on one of the added menu items and something is done based on what was clicked. I can't find anything on how to do this, below is the code for how I am adding the menu item to the menu programatically. </p>
  
  <pre><code>StoredDBConnectionManager storedDbConnectionManager = new StoredDBConnectionManager(Properties.Settings.Default.app_dbPassword);
  List&lt;string&gt; connections = storedDbConnectionManager.getStoredConnections();
  
  foreach (string connection in connections)
  {
        mnuFileDBConnections.Items.Add(connection);
  }
  </code></pre>
  
  <p>Thanks for any help you can provide. </p>