title: WPF Button with Context Menu
body: <p>I am new to WPF and am trying to bind a Context Menu to a Button with the Context Menu items coming from a View Model.</p>
  
  <p>This is what I am doing:</p>
  
  <pre><code>&lt;Button x:Name="btn" Content="Context Menu"&gt;
    &lt;Button.ContextMenu&gt;
      &lt;ContextMenu x:Name="cm" ItemsSource="ItemsList"/&gt;
    &lt;/Button.ContextMenu&gt;
  &lt;/Button&gt;
  
  private List&lt;string&gt; itemsList = null;
  public List&lt;string&gt; ItemsList
  {
    get
    {
      if(itemsList == null)
        itemsList = new List&lt;string&gt;(myStringArrayOfItems);
      return itemsList;                
    }
  }
  </code></pre>
  
  <p>The XAML Editor keeps showing the error: The TypeConverter for "IEnumerable" does not support converting from a string.</p>
  
  <p>What am I doing wrong here?</p>
  
  <p>Also, assuming I get this working, what do I do to bind these items to a command and do some work when the item is clicked? I want to run the same command for all the menu items, just using the item string as a parameter.</p>