title: Using ReactiveUI wpf unable to bind List of Enum values from viewmodel to combobox in view
body: <p>Lets say I have this enum</p>
  
  <pre><code> public enum LogType
       {
           None = 0,
           File = 1,
           Folder = 2
       }
  </code></pre>
  
  <p>I have this ComboBox in view</p>
  
  <pre><code>    &lt;ComboBox Name="CustomLogLogType"  FontSize="10"
                MinHeight="20" Height="20" SelectedItem="{Binding LogType}"&gt;
  </code></pre>
  
  <p>Then a ViewModel like so</p>
  
  <pre><code>public class CustomLogRuleItemViewModel : ReactiveObject
  {
  
      [Reactive]
      public LogType LogType { get; set; } = LogType.File;
  
      public List&lt;LogType&gt; LogTypes =&gt; Enum.GetValues(typeof(LogType)).Cast&lt;LogType&gt;().Where(_ =&gt; _ != LogType.None).ToList();
  }
  </code></pre>
  
  <p>Then in code behind for the view </p>
  
  <pre><code>public partial class CustomLogRuleItemView : ReactiveUserControl&lt;CustomLogRuleItemViewModel&gt; 
  {
      public CustomLogRuleItemView()
      {
          InitializeComponent();
  
          this.ViewModel = new CustomLogRuleItemViewModel();
          this.DataContext = this.ViewModel;
  
          //The below works
          //CustomLogLogType.ItemsSource = this.ViewModel.LogTypes;
  
  
          this.WhenActivated(
              disposables =&gt;
              {
  
                  //If I use below it will error with exception
                  this.OneWayBind(this.ViewModel,
                          _ =&gt; _.LogTypes, _ =&gt; _.CustomLogLogType.ItemsSource)
                      .DisposeWith(disposables);
              });
      }
  }
  </code></pre>
  
  <p>Basically if I bind with below it works</p>
  
  <pre><code>CustomLogLogType.ItemsSource = this.ViewModel.LogTypes;
  </code></pre>
  
  <p>But if i try to use ReactiveUI to do the binding as in below</p>
  
  <pre><code>            this.OneWayBind(this.ViewModel,
                      _ =&gt; _.LogTypes, _ =&gt; _.CustomLogLogType.ItemsSource)
                  .DisposeWith(disposables);
  </code></pre>
  
  <p>I get an exception stating that LogType on ReactiveUI.IViewFor violates the constraint of type 'T'. Unsure why I would be getting something arguing about IViewFor as that just has to do with the ViewModel implementation for view.</p>