title: Two way binding not working in WPF
body: <p>I have a WPF application with several dialogs with lots of controls. I have a dropdown list that is not binding from the C# to the XAML. The other way around works fine.</p>
  
  <p>Here is the C#:</p>
  
  <pre><code>public class AdditionalCostView : ViewBase, IEquatable&lt;AdditionalCostView&gt;
  {
      // ..
      public OfficeReferenceDataView Category
      {
          get { return _category; }
          set
          {
              this._category = value;
              this.OnPropertyChanged("Category");
          }
      }
      // ..
  }
  </code></pre>
  
  <p>and here is the corresponding XAML:</p>
  
  <pre><code>&lt;ComboBox Grid.Row="0" Grid.Column="1" Validation.Error="Validation_Error"
              DisplayMemberPath="Value" SelectedValuePath="ID"
              ItemsSource="{Binding AllCategories}"&gt;
      &lt;ComboBox.SelectedItem&gt;
          &lt;Binding Path="Category" Mode="TwoWay" UpdateSourceTrigger="PropertyChanged"&gt;
              &lt;Binding.NotifyOnValidationError&gt;
                  &lt;sys:Boolean&gt;true&lt;/sys:Boolean&gt;
              &lt;/Binding.NotifyOnValidationError&gt;
              &lt;Binding.NotifyOnSourceUpdated&gt;
                  &lt;sys:Boolean&gt;true&lt;/sys:Boolean&gt;
              &lt;/Binding.NotifyOnSourceUpdated&gt;
              &lt;Binding.NotifyOnTargetUpdated&gt;
                  &lt;sys:Boolean&gt;true&lt;/sys:Boolean&gt;
              &lt;/Binding.NotifyOnTargetUpdated&gt;
              &lt;Binding.ValidationRules&gt;
                  &lt;validators:MandatoryValueValidationRule IsRequired="True"  Message="Please select a category."&gt;&lt;/validators:MandatoryValueValidationRule&gt;
              &lt;/Binding.ValidationRules&gt;
          &lt;/Binding&gt;
      &lt;/ComboBox.SelectedItem&gt;
  &lt;/ComboBox&gt;
  </code></pre>
  
  <p>The AllCategories binding is working fine, but the SelectedItem binding is not. ViewBase implements INotifyPropertyChanged.</p>
  
  <p>When I change the value of Category in my view in C#, nothing happens to the dropdown.</p>
  
  <p>Where am I going wrong?</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>As per comment request, here is the code where I set my value:</p>
  
  <pre><code>private void ctlBooking_PricesAndFees_AdditionalCostEditing(object sender, RoutedEventArgs e)
  {
      try
      {
          AdditionalCostEventArgs args = e as AdditionalCostEventArgs;
          AdditionalCostView costToEdit = args.AdditionalCost;
          AdditionalCostView tempCost = args.AdditionalCost.Clone() as AdditionalCostView;
          // ..
      }
      // ..
  }
  </code></pre>
  
  <p>I know what you're thinking, because I thought the same thing. The Clone() is not copying the values or raising the events, but it is. I wrote it longhand after the clone to explicitly set those values but that still didn't work.</p>
  
  <p>M</p>