title: Pass Enum value as CommandParameter when the Enum is in the ViewModel
body: <p>I am still learning WPF Binding and have been struggling with this for a while.  I have an enum store inside the ViewModel like so:</p>
  
  <pre><code>namespace theNamespace
  {
      public class frmSetupViewModel
      {
          public enum LocationLabelType {Location, Sample}
          ...
      }
  }
  </code></pre>
  
  <p>And I would like have a button pass one of the values via the CommandParameter but cannot figure out how to get it to work.  So far, these are the combinations I have tried:</p>
  
  <pre><code>//When value is inside the frmSetupViewModel, these do not work
  CommandParameter="{x:Static local:LocationLabelType.Location}" //'Type  was not found.'
  CommandParameter="{x:Static local:frmSetupViewModel+LocationLabelType.Location}" //'Type was not found.'
  CommandParameter="{x:Static local:frmSetupViewModel.LocationLabelType.Location}" //'Type was not found.'
  
  CommandParameter="{Binding {x:Static local:LocationLabelType.Location}}" //'Value cannot be null'
  CommandParameter="{Binding {x:Static local:frmSetupViewModel+LocationLabelType.Location}}" //'Value cannot be null'
  CommandParameter="{Binding {x:Static local:frmSetupViewModel.LocationLabelType.Location}}" //'Value cannot be null'
  </code></pre>
  
  <p>But if I move the enum OUTSIDE the VM and into the name space like this:</p>
  
  <pre><code>namespace theNamespace
  {
      public enum LocationLabelType {Location, Sample}
  
      public class frmSetupViewModel
      {
          ...
      }
  }
  </code></pre>
  
  <p>this works just fine:</p>
  
  <pre><code>//Works when enum is moved to Namespace
  CommandParameter="{x:Static local:LocationLabelType.Location}"
  </code></pre>
  
  <p>I assume I am missing something with my CommandParameter?  </p>
  
  <p>The VM is loaded via DataContext:</p>
  
  <pre><code>&lt;Window.DataContext&gt;
      &lt;local:frmSetupViewModel /&gt;
  &lt;/Window.DataContext&gt;
  </code></pre>
  
  <p>Thanks.</p>