title: Databinding an enum to a ComboBox in WPF + MVVM
body: <p>I've read <a href="https://stackoverflow.com/questions/58743/databinding-an-enum-property-to-a-combobox-in-wpf">this very related question here on SO</a>, and it was extremely helpful because of the link in the answer.  I'm just having a problem now going the extra step and making it all work with the MVVM pattern.</p>
  
  <p>Let's say I have my ViewModel, and it (or even the Model) could have an enum defined:</p>
  
  <pre><code>public enum MyTypes { Type1, Type2, Type3 };
  </code></pre>
  
  <p>I want to databind this to a ComboBox in my GUI.  According to the article, I would use an ObjectDataProvider to invoke the Enum.GetValues() method on MyTypes.  So I have to pass MyTypes as a MethodParameter.  But how do you pass the type?  I've tried various methods, like adding the reference to the namespace in XAML:</p>
  
  
  
  <pre><code>    &lt;Window.Resources&gt;
          &lt;ObjectDataProvider MethodName="GetValues" ObjectType="{x:Type sys:Enum}" x:Key="TipHandlingValues"&gt;
              &lt;ObjectDataProvider.MethodParameters&gt;
                  &lt;!-- what goes here?  it's totally wrong. --&gt;
                  &lt;my:MyTypes /&gt;
              &lt;/ObjectDataProvider.MethodParameters&gt;
          &lt;/ObjectDataProvider&gt;
      &lt;/Window.Resources&gt;
  </code></pre>
  
  <p>Pretty much nothing I put there will even compile.  Does anyone know how to get past this little hurdle?</p>