title: Combobox value changes, but visually SelectedValue stays the same
body: <p>I have a combobox with a custom enum (just true/false). I have a function that checks conditions if the SelectedValue changes from false to true and if the conditions are wrong it changes the combobox SelectedValue back to false. This changes the SelectedValue to false if you check it in code, but when you look at the UI it's still on true.</p>
  <p>Here's the xaml for the combobox:</p>
  <pre><code>&lt;ComboBox x:Name=&quot;comboEnabled1&quot; Width=&quot;80&quot; Height=&quot;26&quot;
                            ItemsSource=&quot;{Binding Path=TrueFalseChoices}&quot;
                            SelectedValue=&quot;{Binding Path=Enable1, Mode=TwoWay}&quot;/&gt;
              
  </code></pre>
  <p>Here's the viewmodel</p>
  <pre><code>private TrueFalse _enable1 = TrueFalse.False;
      public TrueFalse Enable1
      {
          get { return _enable1; }
          set
          {
              if (_enable1 != value)
              {
                  _enable1 = value;
                  base.OnPropertyChanged(&quot;Enable1&quot;);
                  OnEnableChanged(EventArgs.Empty);
              }
          }
      }
  </code></pre>
  <p>And here's the function that I'm using to check the conditions</p>
  <pre><code>public void HandleEnable(object sender, EventArgs e)
      {
          if(Enable1 == TrueFalse.True)
          {
              if(!connected)
              {
                  HandleMessage(&quot;Can't enable, not connected&quot;);
                  Enable1 = TrueFalse.False;
              }
              else if (!_main.CBCheck(_main.cbReason))
              {
                  Enable1 = TrueFalse.False;
              }
  
          }
          Console.WriteLine(&quot;Enabled {0}&quot;, Enable1);
  
      }
  </code></pre>
  <p>Was thinking I'm changing the value too rapidly, but the last Console.Writeline produces the right outcome each time.</p>
  <p>Any help appreciated!</p>
  <p>Edit: Calling Handleenable here:</p>
  <pre><code>protected void OnEnableChanged(EventArgs e)
      {
          EventHandler handler = EnableChanged;
          if (handler != null)
              handler(this, e);
      }
  </code></pre>
  <p>And in the ViewModel funct:</p>
  <pre><code>        EnableChanged += HandleEnable;
  </code></pre>
  <p>Changing the Enable1 in any other place worked as it should have, only having issues in HandleEnable function.Also tried changing other comboboxes in the HandleEnable function and that worked as it should have.</p>