title: binding combobox items to dictionary of enums
body: <p>still pretty new at WPF and binding especially, but I have an enum which I will be using as properties on objects elsewhere in my project, but one of the very first kickoff points of the program will be the user selecting a single item from a combobox, which I want to match to the available enum options. I originally thought to have a dictionary object with the enum option as the key, and the value as a string for use in the UI presentation, and this is what I have been working towards. I have been searching around and thought I had it, but the combobox is populating blank.</p>
  
  <p>I have a couple of questions;</p>
  
  <p>Firstly, since I'm still not quite sure what is what in relation to binding, is this issue related to this post <a href="https://connect.microsoft.com/VisualStudio/feedback/details/750518/targetexception-error-in-binding-to-dictionary-string-object" rel="nofollow">Target Exception Bug</a> which I found in a comment on another question? If so, does this mean I'm barking up the wrong tree for the time being? And is there another way for me to achieve my goal?</p>
  
  <p>Secondly, if its not related, have I missed something in the below code? I currently get no error in the output window and the project compiles fine.</p>
  
  <p>Here's the enum (which lives in a separate namespace that has been added to the project references);</p>
  
  <pre><code>namespace WGM_lbr
  {
  public class Available_Wgms
  {
      private static Dictionary&lt;Wgms,string&gt; _wgmColl;
      public static Dictionary&lt;Wgms,string&gt; WgmsCollection 
      {
          get 
          {
              return _wgmColl;
          }
      }
  
      static Available_Wgms()
      {
          _wgmColl = new Dictionary&lt;Wgms, string&gt;() {
              {Wgms.First, "First Dictionary item"},
          //other Dictionary Items go here
          }
      }
  
      public enum Wgms
      {
          First,
          //other Enum options go here
      }
  }
  }
  </code></pre>
  
  <p>My Resource declaration in app.xaml</p>
  
  <pre><code>&lt;Application x:Class="The_First.App"
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
           xmlns:WGM="clr-namespace:WGM_lbr;assembly=WGM_lbr"
           StartupUri="MainWindow.xaml"&gt;
  &lt;Application.Resources&gt;
      &lt;BooleanToVisibilityConverter x:Key="b2v"/&gt;
      &lt;WGM:Available_Wgms x:Key="WgmList"/&gt;
  &lt;/Application.Resources&gt;
  </code></pre>
  
  <p></p>
  
  <p>And finally the combobox and binding xaml (in case its relevant, this lives in a nest of wpf controls, up to a grid which lives on page, which is being loaded to mainwindow.xaml via a frame control using the page as the source. Both the page and mainwindow have declared the WGM namespace - I cut these out as this post is already long enough);</p>
  
  <pre><code>&lt;ComboBox Name="cmbWgmSelector" Margin="5,0" ItemsSource="{Binding Source={StaticResource WgmList}}"/&gt;
  </code></pre>
  
  <p>Any help/advice that can be provided is greatly appreciated.</p>